Cookies and personalization information
With Discover, you can pass many attributes with your request to personalize the user experience. You do this through The context request object and its nested Context type objects. To get a successful response, you must pass cookies in the header.
While all other personalization attributes other than cookies are optional, we strongly recommend that you pass as many context values as possible. This is so that Discover can present the most personalized experience possible to your users.
The following table lists a few of the context attributes you can pass.
|
Parameter |
Description |
|---|---|
|
|
Uri of the page the user is requesting. |
|
|
Referring uri you received as part of the header in the request. |
|
|
IP address of the request you received from the user's browser or native application. |
|
|
User agent of the browser that you received in the header of the request. |
|
|
Pass these in your request header. These are cookies that Discover sets on the your domain. All cookies start with These cookies are required to:
|
|
|
When you pass the cookies, you usually also pass the |
In the following sample request, you ask for a widget with specific page, user, geo, and browser contexts:
{
"context": {
"page": {
"uri": "/category/men/shirts?color=red",
"referrer": "https://riggsandporter.com/category/men?color=red"
},
"user": {
"uuid": "125757321-ph-eb-4w-1p-tvfxk0rs1iwgp5tsgdvt-1523635809203"
},
"geo": {
"ip": "20.230.240.14"
},
"browser": {
"user_agent": "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
}
}
…