The updateContext object model
The updateContext object is used to update page and widget context using the Sitecore Discover beacon and rfk.push(). It defines the widget(s) that the context applies to and the contexts and filters to set.
The following table describes the keys for the updateContext object:
| Key | Value type | Description | Notes |
|---|---|---|---|
widget | widget object | Widgets that this updateContext applies to. | If not specified, context applies to all widgets on the page. |
context | context object | Context to apply. Might include information on user, page, store, and so on. | |
filter | filter object | Filters to apply. | |
apply_once | Boolean | Flag for context persistence after widgets refresh. | Defaults to false, meaning that context persists for the full duration of the page interaction. |
The widget object
The following table describes the widget object key:
| Key | Value type | Description |
|---|---|---|
rfkids | array of strings | Array of rfkids of every widget that the context applies to. |
The filter object
The following table describes the filter object key:
| Key | Value type | Description |
|---|---|---|
| array of strings | An array of filters to apply |
The context object
The context object used in updateContext contains objects representing contextual information about the user, store, campaign, page, and fitment. It is similar to the event context object, but its sub-objects have fewer available keys.
The following table lists the keys of the context object:
| Key | Value type | Description |
|---|---|---|
user | user object | Object defining the user context. |
store | store object | Object defining the store context. |
campaign | campaign object | Object describing the campaign context. |
page | page object | Object describing the context of the page. |
fitment | fitment object | Object describing the fitment context. |
The user object
The following table describes the user object key:
| Key | Value type | Description | Notes |
|---|---|---|---|
groups | array of strings | Custom groups or segments assigned to the user. | For B2B websites, use the store object. |
The store object
The following table describes the keys of the store object:
| Key | Value type | Description | Notes |
|---|---|---|---|
id | string | Store id. This ID must be consistent with the id shared as part of the full product feed. | B2B websites use this to identify a restriction id associated with a customer. If a restriction is based on the customer id, specify the customer id. If you have a restriction id that is different than customer id, use the specific restriction id. |
group_id | string | group_id. If your stores are organized in two level hierarchy (for example as zones and stores), you can pass the top level organization identifier as group_id. This id must be consistent with group_id shared as part of product feed. | For B2B websites, if your restrictions are organized in two levels, then pass the restriction group id as group_id. If restriction is based on the customer group id, specify the customer group_id. If you have a restriction group id that is different then customer group id, use the specific restriction group id. |
The campaign object
The following table describes the keys of the campaign object:
| Key | Value type | Description |
|---|---|---|
utm_source | string | utm_source campaign parameter. |
utm_campaign | string | utm_campaign campaign parameter. |
The page object
The following table describes the keys of the page object:
| Key | Value type | Description |
|---|---|---|
sku | array of strings | Array of product SKUs. |
category_uri | string | URI representing a category. |
ccid | string | An ID representing a category provided as part of the category feed. This field is ignored if category_uri is specified. |
category_id | integer | The Discover id that represents a category. This is an internal id assigned by Sitecore Discover. This field is ignored if category_uri or ccid is specified. |
locale_country | string | The country specified as part of the locale context based on ISO 3166 Alpha 2 country code. |
locale_language | string | The language specified as part of the locale context based on ISO 639-1 standard language codes. |
The fitment object
The following table describes the keys of the fitment object:
| Key | Value type | Description |
|---|---|---|
ids | array of strings | Array of fitment IDs. |
items | array of fitment objects | For rare cases when you do not have fitment IDs associated with fitments in your system. We recommend the use of IDs where possible. |
You must provide either IDs or items, not both. If both are provided, items are ignored.