The context request object
Use a context object to specify the types of context you want to retrieve in the response. You can add different <context_types> in your request, such as information about the user, browser, geographic location, store, fitment, page, campaign, and channel to make results more relevant.
The following shows the basic structure of a context object in a request:
Key
Key
The following table describes the keys that the context object contains:
| Key | Type | Description | Values |
|---|---|---|---|
| context_type | Context type object | Optional.Contains the supported context object type.You can have more than one context_type. | channelcampaignpagefitmentstoregeobrowseruser |
| context_key | array | Optional.Contains the <context_key_values> that correspond to the fields in each context object type.You can have more than one context_key. | n/a |
Context type objects
The following table describes the supported context objects:
| Object | Type | Description |
|---|---|---|
user | User context object | User details including IDs, gender, email address, and group. |
browser | Browser context object | User device or browser information. |
geo | Geo context object | User location including geographic information and IP address. |
store | Store context object | Store ID associated with the user. |
fitment | Fitment context object | User fitment information. |
page | Page context object | Page details including URL, title, IDs, list of products, and locale information. |
campaign | Campaign context object | Campaign information including utm_source and utm_campaign. |
channel | Channel context object | Channel information. |
Example
Example
In this example, you apply a user context for gender:
}
If you have suggestions for improving this article, let us know!