A condition that must be satisfied for using some content (sub)settings. A condition is an object with a field type as well as other fields that vary with the type. The following fields are common to all condition types:
|
Name |
Type |
Description |
|---|---|---|
|
|
boolean |
If true, the condition is considered paused and will always fail to be satisfied. Default is false. |
The condition types are as follows:
"time"
Satisfied if all of listed conditions are true:
-
Time of day¹ is between
from(inclusive) andto(exclusive) -
Current date¹ is between
fromDate(inclusive) andtoDate(exclusive) -
Current day¹ of the week is in
days
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
A time of day¹, between "00:00" and "23:59". |
|
|
String |
A time of day¹, between "00:00" and "23:59". |
|
|
String |
A date¹ with optional time¹. |
|
|
String |
A date¹ with optional time¹. |
|
|
Array of Integer |
A set of integers between 1 (Monday¹) and 7 (Sunday¹). |
¹ Using the time zone of the widget site. fromDate and toDate can also be specified as a full ISO 8601 date time with explicit time zone.
"condition":{"type":"time", "from":"09:00", "to":"16:00", "fromDate":"2017-10-29T00:00:00+01:00", "toDate":"2017-11-07T10:00:00", "days":[1,2,3,4,5]}
###Examples
Given date 2017-10-25 If 'fromDate' is 2017-10-25 and 'toDate' is 2017-10-26 we will have a match (inclusive 'fromDate'). If 'fromDate' is 2017-10-24 and 'toDate' is 2017-10-25 we will not have a match (exclusive 'toDate').
"user"
Satisfied if the user profile of the current user contains a certain item. See "device" and "location" conditions for conditions based on the current device or location. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
A user profile group. |
|
|
String |
An item that must be found in the in the user profile group of the current user. |
|
|
Array of String |
An array of items, at least one that must be found in the user profile group of the current user. |
|
|
A range object |
A range of values that at least one item must be within. |
|
|
Integer |
A number between 0 and 100 (inclusive). If specified, the weight of the item must be greater than or equal to this value / 100. |
|
|
Boolean |
If true, match only this item if it is the item with the largest weight in the group (for this user). |
|
|
Boolean |
If true, condition is satisfied when looking up user profile fails due to timeout or other technical reasons. |
|
|
String |
If |
Exactly one of item, items and itemRange must be provided.
"condition":{"type":"user", "group":"user-region", "item":"california", "threshold":25, "topItem": true}
Range object
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Either |
|
|
String or number |
Item must be greater than or equal to this lower bound |
|
|
String or number |
Item must be less than this lower bound |
At least one of from and to must be specified. Items in the user profiles is assumed to be formatted accordingly.
For type time, items must be ISO8601 formatted timestamps, and from and to must be either ISO8601 formatted timestamps or time offsets such as "-1w" or "5h". Possible units are seconds,minutes,hours,days,weeks,Months,years. For type number, both items, from and to must be integers or reals like 1.0.
"content"
Satisfied if the content profile of the page hosting the widget (i.e. context url) contains a certain item. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
A content profile group name. Both internal and customer-prefixed group names are allowed. |
|
|
String |
An item that must be found in the in the content profile group. |
|
|
Array of String |
An array of items, at least one which must be found in the content profile group. |
|
|
A range object |
A range of values that at least one item must be within. |
|
|
Integer |
A number between 0 and 100 (inclusive). If specified, the weight of the item must be greater of equal to this value / 100. |
|
|
Boolean |
If true, match only this item if it is the item with the largest weight in the group (for this content profile). |
|
|
Boolean |
If true, condition is satisfied when looking up user profile fails due to timeout or other technical reasons. |
Exactly one of item, items and itemRange must be provided.
"condition":{"type":"content", "group":"location", "item":"new york"}
"userSegment" (requires Cxense DMP)
Satisfied if the current user belongs to the given segment.
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
An identifier of a user segment in the same site group as this content configuration object. |
|
|
String |
A type of a user segment in the same site group as this content configuration object. One of 'traffic', 'external' or 'lookalike'. |
"condition":{"type":"userSegment", "segmentId":"87f71b483e4255ccbee08da1ed90bedf52c74071", "segmentType":"traffic"}
"context"
Satisfied if the current page (where the widget is found) has certain properties. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Either "article" or "frontpage". ( |
|
|
String |
Either "negative" or |
|
|
Boolean |
|
|
|
String |
The type of the categories matched. |
|
|
Array of String |
If not |
|
|
Array of String |
If not |
|
|
Array of String |
If not |
"condition":{"type":"context", "pageclass":"frontpage", "categoryType":"taxonomy", "categories":["sport/football"]}
Best practice available: [Using "context" as a dynamic parameter for content-configurations](page://Using "context" as a dynamic parameter for content-configurations)
"referrer"
Satisfied if the http referrer host belongs to one of the given classes. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of String |
Referrer is equal to one of the given URLs. URLs are normalized to determine equality. |
|
|
Array of String |
Referrer host name is one of the given hosts. Host names are normalized to determine equality. |
|
|
Array of String |
Referrer is recognized as a search engine, and the search query is one of the given queries. |
|
|
Array of String |
Referrer host belongs to one of the given classes. The classification is based on the referrer top-level domain name. Possible values are |
|
|
Array of String |
Referrer is recognized as one of the given search engines, for |
|
|
Array of String |
Referrer is recognized as one of the given social networks, for |
"condition":{"type":"referrer", "hostClasses":["search", "internal"], "socialNetworks":["LinkedIn"]}
This is satisfied if the referrer is either
-
a search engine, or
-
a page in the same domain as the current url, or
-
the social network LinkedIn.
"location"
Satisfied if the location of the user (as determined by the user's IP address) has one of the given properties. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of String |
The location is for one of the given countries, specified as lowercase two-letter country code (ISO-3166-1 alpha-2). Examples: "us", "no". |
|
|
Array of String |
The location is for one of the given geographical regions. |
|
|
Array of String |
The location is for one of the given cities. |
|
|
Array of String |
The location is for one of the given companies. |
|
|
Array of String |
The location is for one of the given metrocodes. Examples: "itv london". |
|
|
Array of String |
The location is for one of the given postal codes. Examples: "M6J 2R7", "0268", "10023". |
|
|
Array of String |
The location is for one of the given iso regions. Examples: "uk-swk". |
"condition":{"type": "location", "countries": ["us", "no"]}
"device"
Satisfied if the device of the user (as determined by the user agent http header) has one of the given properties. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of String |
The type of device is of one of the given types. |
|
|
Array of String |
The device is running one of the given operating systems. |
|
|
Array of String |
The device is running one of the given browsers. |
|
|
Array of String |
The device is running one of the given browser versions. |
|
|
Array of String |
The device is of one of the given mobile brands. |
"condition":{"type": "device", "browserOss": ["iPhone OS"]}
"and"
Satisfied if all the sub-conditions are satisfied. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of Object |
Conditions that must all be satisfied. |
Example:
"condition":{"type":"and", "conditions":[{"type":"user", ...}, {"type":"context", ...}]}
"or"
Satisfied if at least one of the sub-conditions are satisfied. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of Object |
Conditions where at least one must be satisfied. |
"condition":{"type":"or", "conditions":[{"type":"user", ...}, {"type":"context", ...}]}
"not"
Satisfied if the sub-condition is not satisfied. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Object |
Condition that must not be satisfied. |
"condition":{"type":"not", "condition":{"type":"context", ...}}
"impressionCapping"
The impressionCapping condition is used for limiting the number of times a branch with the given tag will return results. The impression capping is based on impressions logged on the tag for given widget configuration. One impression is logged per item returned in the result. Users will be exposed to results up to and including the count (number of impressions) during a period. Impressions from backfill items will not be counted. The condition will read impressions tracked from branches with the same leaf tag as the impression capping tag on the same widget configuration. Fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
int |
Bigger than 0. |
|
|
int |
Deprecated A number in seconds between 0 and 2678400 (inclusive). Where 2678400 equals 31 days |
|
|
String |
A period that is max 31 days. |
|
tag |
String |
Acts as a label for the impression capping. This must only contain lowercase ascii letters (a-z) or digits (0-9). Maximum length is 10. |
|
|
String |
Default is |
|
|
String |
Default is |
"condition":{"type":"impressionCapping","count":"12", "period":"12h", "tag":"subscribe"}
"event"
The event condition can be used to find pageviews for a given user. This can be used to do branching based on loyalty and on time since the last visit on the page. min=1 during a period means that the user has at least one pageview in that period, which means the user has visited the site. Many pageviews during a period might also suggest a better profile on the user.
|
Name |
Type |
Description |
|---|---|---|
|
|
Integer |
0 or greater. The minimum number of pageview events for this condition to be true. |
|
|
Integer |
0 or greater. The maximum number of pageview events for this condition to be true. |
|
|
int |
Deprecated A number in seconds between 0 and 2592000 (inclusive). Where 2592000 equals 30 days |
|
|
String |
A period that is max 30 days. |
"condition":{"type":"event","min":"5", "max":"7", "period":"8d"}
"userEngagement"
The userEngagement condition can be used to target the audience based on the number of days they have visited the siteGroup during the provided period. max=0 during a period means that the user has not yet visited the site before the condition is checked so that allows to target the first time visitors.
|
Name |
Type |
Description |
|---|---|---|
|
|
Integer |
0 or greater. The minimum number of visit days for this condition to be true. |
|
|
Integer |
0 or greater. The maximum number of visit days for this condition to be true. |
|
|
String |
A period that is max 30 days. |
"condition":{"type":"userEngagement","min":"5", "max":"7", "period":"8d"}