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:

KeyValue typeDescriptionNotes
widgetwidget objectWidgets that this updateContext applies to.If not specified, context applies to all widgets on the page.
contextcontext objectContext to apply. Might include information on user, page, store, and so on.
filterfilter objectFilters to apply.
apply_onceBooleanFlag 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:

KeyValue typeDescription
rfkidsarray of stringsArray of rfkids of every widget that the context applies to.

The filter object

The following table describes the filter object key:

KeyValue typeDescription
array of stringsAn 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:

KeyValue typeDescription
useruser objectObject defining the user context.
storestore objectObject defining the store context.
campaigncampaign objectObject describing the campaign context.
pagepage objectObject describing the context of the page.
fitmentfitment objectObject describing the fitment context.

The user object

The following table describes the user object key:

KeyValue typeDescriptionNotes
groupsarray of stringsCustom 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:

KeyValue typeDescriptionNotes
idstringStore 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_idstringgroup_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:

KeyValue typeDescription
utm_sourcestringutm_source campaign parameter.
utm_campaignstringutm_campaign campaign parameter.

The page object

The following table describes the keys of the page object:

KeyValue typeDescription
skuarray of stringsArray of product SKUs.
category_uristringURI representing a category.
ccidstringAn ID representing a category provided as part of the category feed. This field is ignored if category_uri is specified.
category_idintegerThe 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_countrystringThe country specified as part of the locale context based on ISO 3166 Alpha 2 country code.
locale_languagestringThe 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:

KeyValue typeDescription
idsarray of stringsArray of fitment IDs.
itemsarray of fitment objectsFor rare cases when you do not have fitment IDs associated with fitments in your system. We recommend the use of IDs where possible.
Note

You must provide either IDs or items, not both. If both are provided, items are ignored.

If you have suggestions for improving this article, let us know!