We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

Content settings object

A content settings object is a part of a content configuration object or of another content settings object (since some settings contain internal (sub)settings or branches).

Each content settings is defined by a field type. The type of settings determines what other setting fields are valid. Observe that at this level, if a field is not specified in an update, it is interpreted as null. In other words, any existing value will be lost.

Common Settings for all Types

Every "branch" of a content settings object, regardless of type, may contain the following settings:

Name

Type

Description

comment

String

Best practice: This field has no effects, but it can e.g. be used to explain why these particular settings were chosen.

tag

String

Best practice: At most 10 digits and lower case letters (a-z) that can be used in. At most 10 tags can be specified in the content settings object.

weight

Integer

The relative frequency of results using these settings (when part of combined or randomized settings). The default branch "weight" is 10

boost

Integer

Favor results from this branch (for sub-branches of uniquified settings)

condition

Object

The condition for picking this branch inside a conditional type content setting, see

Content settings conditions

.

itemDefaults

Object

Default field values for these (sub)settings. Only string values are supported. With itemDefaults one can inject key/value pairs into the items response data as predefined additional resultFields. They are availlable as additional data e.g. in the "Templates" for rendering a widget content or control its layout. Values are allowed to contain

placeholders

.

Specific Settings for Types

Basic Types (must exist at least once)

"fixed"

Return a list of (zero or more) predefined results. Useful for testing or user-messages controlled by Cxense Content targeting.

Name

Type

Description

items

Array of Objects

Predefined recommendations that will be returned for this widget (or branch). Top level item values may contain

placeholders

.

reporting

Array of Objects

Object with key value pair. See

details

.

"recs"

Fetch content recommendations. Special fields (some fields have default values):

Name

Type

Description

siteIds

Array of String

Identifiers of the sites where the recommendations should come from (i.e. point to). All these sites must belong to the site group specified in the content configuration. Each site id is allowed to be a

placeholder

.

matchingMode

Object

See below.

resultFields

Array of String

Fields you need in the recommendation response, e.g. as input for the "Template" (such as title, url, ...).

maxAge

Integer

Deprecated No article should be more than this number of minutes old (when rounded off). Default is arbitrarily old results. Calculated on the field recs-publishtime.

maxAge

String

No article should be more than this old (when rounded off). Represented by a

period

. Default is arbitrarily old results. Calculated on the field recs-publishtime.

minAge

Integer

Deprecated Every article should be at least this number of minutes old. Calculated on the field recs-publishtime.

minAge

String

Every article should be at least this old. Represented by a

period

. Calculated on the field recs-publishtime.

maxTimeLeft

Integer

Deprecated Only recommend articles with at most this number of minutes until expiration. Calculated on the field recs-expirationtime (if available).

maxTimeLeft

String

Only recommend articles with at most this amount of time until expiration, represented by a

period

. Calculated on the field recs-expirationtime (if available).

minTimeLeft

Integer

Deprecated Every article should have at least this number of minutes left before expiration. Calculated on the field recs-expirationtime (if available).

minTimeLeft

String

Every article should have at least this amount of time left represented by a

period

, before expiration. Calculated on the field recs-expirationtime (if available).

query

String

Custom query string (see

/document/search

) used for post filtering. The query is applied on the result set from analytics, and it is useful to remove some unwanted results. However, it should not be used as the main filtering mechanism, since it will not find results not already a part of the analytics result set.

filter

String

Custom filter string (see

/document/search

).

overrideMapping

String

Custom override mapping. This field has an undocumented format that will change in the future.

duplicateRemovalKey

String

Custom duplicate removal key (Note that this takes effect per branch)

categoryType

String

Used with recs requests that specify liked/disliked categories.

enableKeywords

Boolean

Whether results should be boosted for requests containing keywords (see

/public/widget/data

). null means false.

ignoreUser

Boolean

If true, do not personalize these recommendations. This is not meaningful for all matching modes.

ignoreUserLikes

Boolean

If true, do not respect user categories preferences passed in the request for these recommendations.

ignoreContext

Boolean

If true, do not adjust these recommendation based on the current context. This is not meaningful for all matching modes.

trafficFilter

Object

Traffic filter

to customize the matchingMode trend or aiTrendBehavioral.

rank

String

How much should recency impact the ranking of recommendations. Possible values: norank, publishfreshhigh, publishfreshmed, random. Suitable for i.e. recommending related / interest based ever green content. Warning: provided rank will override the default similarity-based ranking of AI embeddings based modes, such as aiContextual.

reporting

Array of Objects

Object with key value pair. See

details

.

deboost

String

A

time period

indicating which impressions are counted for impression deboosting. Deboosting will cause documents the user has already been recommended (or read) to be ranked lower. No deboosting is performed on results from matching mode "recent".

pageviewCapping

Object

Configures pageview capping. See

details

.

noBackfill

Boolean

When set to true, no backfill results are delivered. Default is false, since backfill is usually better than no results.

Details for minAge, maxTimeLeft or minTimeLeft

Setting minAge: 0m, 0d or 0w means that results with future publish dates are not allowed. This value is also allowed to be negative. For sites read in many time zones, it is recommended to set this to -1d when used.

Observe that setting maxTimeLeft or minTimeLeft has the effect that only elements that have an expiration time will be recommended.The expiration time can be set using a meta tag cXenseParse: recs:expirationtime as described on the page [Cxense Content - Review and Refinement](page://Cxense Content - Review and Refinement).

If minTimeLeft is not specified, then no article will be recommended that has an expiration time that has passed.

Details for "reporting"

The reporting object contains a key-value pair. The key has a maximum length of 30 characters. The value has a maximum length of 40 characters.

The value and key can be replaced with placeholders.

The reporting parameters will be added to the custom parameters on the DMP impression or click event.

"reporting": [{"key" : "segment", "value" : "32gfdeyt244r"},{ "key" : "mode", "value" : "contextual"}]
Details for matchingMode

A matchingMode object may contain the following fields:

Name

Type

Description

trend

Object / Integer

The trending articles, i.e. the articles that are most popular recently.

aiTrendBehavioral

Object / Integer

The trending articles, i.e. the articles that are most popular recently, ranked by the user past interests based on AI embeddings.

contextual

Object / Integer

Articles similar to the current article.

aiContextual

Object / Integer

Articles similar to the current article based on AI embeddings.

aiContextualBehavioral

Object / Integer

Articles similar to the current article, ranked by the user past interests, based on AI embeddings.

behavioral

Object / Integer

Articles similar to those the current user has previously read.

aiBehavioral

Object / Integer

Articles similar to the user past interests based on AI embeddings.

collabctx

Object / Integer

People who have read the current article have also read these articles.

collabusr

Object / Integer

People similar to the current user have also read these articles.

explicit

Object / Integer

No additional matching. Uses query, filter and rank to find results. Deprecated. Use matching mode search instead.

search

Object / Integer

No additional matching. Uses query, filter and rank to find results.

recent

Object

Articles with recent events for the current user, either by pageviews or by DMP events depending on the event field. Recommendations are in sorted order, most recent first. Note that no deboosting or pageview capping is performed for this matching mode.

rate

Object

Articles that have a high click through rate when displayed in content widgets. Experimental: This matching mode is experimental. The algorithm can change or be removed in the future.

An integer n is interpreted as the object { "weight": n }. At least one mode field with non-zero weight must be specified.

An individual matchingMode settings object may contain the following fields:

Name

Type

Description

weight

Integer

Relative weight (non-negative). This field is required.

period

Integer

Deprecated Only recommend articles with traffic (page-views) tracked this seconds old. (Only supported for trend, aiTrendBehavioral, collabctx, collabusr, and rate.) Maximum: 604800 seconds (7 days)

period

String

Only recommend articles with traffic (page-views) tracked this old. (Only supported for trend, aiTrendBehavioral, collabctx, collabusr, and rate.) A

period

that is maximum: 7 days

sort

Array ofsort objects

The recommended documents for the query/filter is decided according to this sort specification. Only supported for search. Defaults to descending sort by score. Sort objects are specified as for

/document/search

.

Placeholders

are supported for the fields: order, field, longitude and latitude. Note that sort is not used to decide the sorting order of the articles appearing in the widget, as these can be a combination of several matching modes or backfill.

event

Object

Specified as an object with required string field type and optional string field origin. When type is "pageview", recommends the current user's recently viewed articles. When a DMP event type and *origin *is specified, recommends the current user's most recent articles where such an event occurred. Only supported for recent.

maxScore

Float

Only recommend articles with at most this similarity score (as computed by the similarity function on the AI embeddings). Similarity score is a floating point value in the range between -1 and 1, where 1 is almost identical and -1 is completely dissimilar article. Only applicable to AI embeddings based matching modes.

minScore

Float

Only recommend articles with at least this similarity score (as computed by the similarity function on the AI embeddings). Similarity score is a floating point value in the range between -1 and 1, where 1 is almost identical and -1 is completely dissimilar article. Only applicable to AI embeddings based matching modes.

Examples:

  • "trend": {"weight": 1, "period": "1h"}} means: Give me the most read articles of the last hour.

  • "search": {"weight": 1, "sort": [{"type": "string", "field": "xyz-myfield", "order": "ascending"}]} means: Give me the articles matching the query/filter where xyz-myfield is first alphabetically.

  • "recent": {"weight": 1, "event": {"type": "buy", "origin": "xyz-shop"}} means: Give me the user's most recent purchases (articles where DMP "buy" event occurred).

Period specification

A time period specified as an offset such as "1000s" (within last 1000 seconds) or "2w" (within last two weeks). Possible units are seconds,minutes,hours,days,weeks,Months,years.

Details for resultFields

In the field resultFields you specify the fields returned for each article. However, this does not restrict the result set in any way. If you want to make sure that every article returned has certain fields, then this must be specified using filter. If resultFields is not specified, then it is given a default initial value.

Possible result fields include contenthash, description, dominantimage, dominantimagedimensions, dominantthumbnail, dominantthumbnaildimensions, id, keywords, kw-category, og-description, og-image, og-title, og-type, og-url, publishtime, recs-publishtime, recs-rawtitle, siteid, thumbnail, thumbnailfullheightdimensions, timestamp, title, wordcount, charactercount, url. The url result field will automatically include the result field click_url as well.

Details for pageviewCapping

Recommended documents for which the user has at least count number of pageviews in the last period are excluded (capped) from the result. No pageview capping is performed for results from matching mode "recent".

Name

Type

Description

period

String

A

time period

indicating which pageviews are counted.

count

Positive integer

Optional, default value 1.

Time period specification

A time period specifying which events to be included, specified as one of:

  • published – all events are counted. This is the default value.

  • modified – only events since the document was last modified are counted.

  • never – no events are counted.

  • An offset such as "1000s" (only count events from last 1000 seconds) or "2w" (only count events from last two weeks). Possible units are seconds,minutes,hours,days,weeks,Months,years.

Example:

  • No pageview capping: pageviewCapping": {"period": "never"}

"import"

Import existing content settings object as a child branch of this node.

The import is resolved for each data request, not copied into and stored with the parent configuration. Thus, any change to the imported content will be reflected in the parent configuration. Defaults from the parent configuration will be applied to the imported configuration. When creating or updating the parent configuration, the imported content must exist and come from the exact same site group. If the imported content is missing, the importing node will silently return no results.

Name

Type

Description

contentId

String

Identifier of another content object to import.

"creative"

Return the fields from a creative.

Name

Type

Description

creative

Identifier of creative.

reporting

Array of Objects

Object with key value pair. See

details

.

The creative is returned as an item with its elements in fields, similar in format to results from the recs settings.

For example, the creative with elements

JavaScript
[
 {"type": "text", "name": "header", "text": "My header"},
 {"type": "image", "name": "header_image", "filename": "my_image_100_by_200.png"}
]

Might yield a single item with the following fields:

JSON
{
 "header": "My header",
 "header_image": "https://content.cxpublic.com/creatives/12345678910.png",
 "header_imagedimensions": "100x200"
}

Composition Types

"combined"

Combine results from several branches for the same request. By giving the branches different weight, you can get more results from some branches than others.

Each combined content settings object should normally be wrapped in a uniquified object. This serves two purposes: Avoid duplicates and keep the best results, regardless of branch.

Name

Type

Description

branches

Array of Objects

Array of content settings objects.

bufferElements

Integer

Deprecated: Has no impact.

ordering

Array of Integer

The order in which the recommendations should appear.

Example: The ordering [0, 2, 2, 2, 1] means: Take one recommendation from the first branch, three from the third branch and one from the second branch. After that, we take any remaining recommendations from the first branch, then from the second branch, and so forth.

If the branches can return overlapping results, you should wrap this in a uniquified object.

Since these branches are computed in parallel, there is a limit on the number of (combined) branches allowed. Observe that recs settings with keywords enabled or many site IDs may count as more than one branch.

"conditional"

Distribute the content requests between several branches based on facts about the current time, user and/or page.

Name

Type

Description

branches

Array of Object

Non-empty array of content settings objects.

The field condition can optionally be specified on the branches. The first branch whose condition is satisfied will be chosen. The branches without a condition field are called fallback branches. There must be at least one fallback branch, and no branch after a fallback branch can specify a condition. Note that it is not required for any branch to have a condition.

If no branch has its condition satisfied, a weighted random branch will be chosen among the fallback branches. Each fallback branch can have a field weight which specifies how often these sub-settings should be used (relative to the other branches). The default branch weight is 10.

"randomized"

Deprecated. Use "conditional".

"shuffled"

Shuffle the order of results from the inner content provider. Special fields:

Name

Type

Description

innerSettings

Object

Content settings object whose results should be shuffled.

level

Integer

Level of shuffling:0 - no shuffling (order unchanged)100 - random order (default)

"uniquified"

Remove duplicate results. Special fields:

Name

Type

Description

innerSettings

Object

Content settings object whose results should be uniquified.

margin

Integer

Level of "over-booking", described below. The default margin is 200.

preference

String

Either best (the default) or unmodified. Other options may be added later. Here best means that the results will also be reordered with the best results first. What is considered best can be affected by setting the boost field of any sub-settings (usually a value between -200 and 200).

To make sure we have enough results left after deduplication, we must ask the inner content provider for some extra results. Margin:

  • 0 - no over-booking (results in too few results when there are duplicates)

  • 100 - ask for 100% more (twice as many) articles

  • 200 - ask for 200% more...

"budget"

Don't recommend articles where number of impressions/clicks/page views are over a specified budget. Events are counted within the site of the widget, so two widgets belonging to the same site will share a budget.

Budget restrictions only apply for up to 100 articles per customer per day.

Special fields:

Name

Type

Description

innerSettings

Object

Content settings object whose results should be limited by a budget.

maxImpressions

Number

Remove URLs that have more than this number of impressions.

maxClicks

Number

Remove URLs that have more than this number of clicks.

maxPageviews

Number

Remove URLs that have more than this number of page views. May not be specified together with maxImpressions or maxClicks.

period

String

Only include events within this

period

. No more than one month is allowed. Default is to count all available events.

Best Practice Types

"defaults"

It is a best-practice to define defaults for any kind of content settings.

Name

Type

Description

innerSettings

Object

Content settings object affected by these defaults.

importFromContentId

String

Identifier of another content object to import additional defaults from.

[any field]

...

Default value.

In a settings object with many branches you may end up specifying the same parameters over and over (e.g. resultFields will typically be the same everywhere). The purpose of defaults is to simplify this: A property specified in the defaults does not have to be repeated in the innerSettings, but it can be overridden.

If defaults are nested, the innermost default value is used. Observe that the common fields (such as tag, weight or condition) are not interpreted as default values.

The content settings referenced using importFromContentId must consist of a single defaults node without innerSettings. The specified fields override any fields from the imported content settings. The import is resolved for each data request, not copied into and stored with the parent configuration. Thus, any change to the imported content will be reflected in the current configuration. When creating or updating the configuration, the imported content must exist and come from the exact same site group. If the imported content object is deleted, importFromContentId will have no effect.

Example: { "type": "defaults", "siteIds":[ "01234" ], "innerSettings": ... { "type": "recs", [settings that do not have to specify siteIds] } ... }

Miscellaneous Types

"schemeAdjusted"

The effect of this type of settings is that certain URLs are rewritten if the current page is secure (https). This is done in order to avoid "mixed content" warnings.

Name

Type

Description

innerSettings

Object

Content settings object whose results should be modified.

fields

Array of String

The list of fields containing URLs that should be rewritten.

Example of very basic content widget settings

Serves as an illustration of a starting point how to mix a recommendation based on

  • the most popular articles of the last 24h (=>trend and period)

  • the articles which fits best the context of the page the recommendation widget is placed on (=>contextual)

  • the articles which fits best the users interest (=>behavioral)

  • no article should be published more then 7 days ago (=>maxAge).

  • article must contain some image (=>"query for domaintthumnail")

JSON
{
 "type": "recs",
 "siteIds": [
 "your_siteid_goes_here"
 ],
 "matchingMode": {
 "trend": {
 "weight": 10,
 "period": "1d"
 },
 "behavioral": {
 "weight": 5
 },
 "contextual": {
 "weight": 5
 }
 },
 "resultFields": [
 "dominantimage",
 "title",
 "teaser",
 "url"
 ],
 "maxAge": "7d",
 "query": "query(dominanthumbnaildimensions:\"*\")"
}

Example of complex content widget settings

Observe that this example is rather far-fetched.

JSON
{
 "type": "schemeAdjusted",
 "fields": [ "dominantthumbnail" ],
 "innerSettings": {
 "type": "combined",
 "ordering": [1, 1, 0],
 "branches": [
 {
 "type": "fixed",
 "comment": "This is a random comment",
 "weight": 1,
 "items": [
 {
 "url": "https://www.cxense.com",
 "title": "Cxense",
 "description": "Extraordinary insight",
 "dominantthumbnail": "https:///www.cxense.com/wp-content/themes/cxense/css/img/cxense_logo.png"
 }
 ]
 },
 {
 "type": "randomized",
 "weight": 9,
 "branches": [
 {
 "type": "shuffled",
 "level": 50,
 "innerSettings": {
 "type": "recs",
 "weight": 95,
 "matchingMode": {
 "trend": { "weight": 1, "period": "1h" }
 },
 "query": "query(dominantthumbnaildimensions:\"*x*\")",
 "siteIds": [ "9222300729399686919" ]
 }
 },
 {
 "type": "uniquified",
 "weight": 5,
 "margin": 150,
 "innerSettings": {
 "type": "recs",
 "matchingMode": {
 "trend": { "weight": 50 },
 "behavioral": { "weight": 50 }
 },
 "resultFields": [ "url", "title", "description", "dominantthumbnail" ],
 "siteIds": [
 "9222300729399686919",
 "9222311772423575900"
 ]
 }
 }
 ]
 }
 ]
 }
}

Last updated: