Ad request
What your backend sends for one page view: the placements to fill and the page context.
- Sent to:
POST /server/v2/ads
Fields
| Field | Type | Required | Description |
|---|---|---|---|
domain_id | integer | Yes | Your domain id: the number of your market on GoWit. GoWit shares it with your host and keys. Stage and production use their own values. |
session_id | string | Yes | The shopper's session id. Keep it stable for the whole attribution window: impressions, clicks and sales are matched to ads by it. |
placements | object[] | Yes | The slots on this page that should be filled. Each is answered in order. |
placements[].placement_id | integer | Yes | The key of the placement, set when the placement was created. See Placements. |
placements[].placement_identifier | string | No | Your own label for the slot. It is echoed back on the response so you can route ads to the right slot. |
placements[].max_ads | integer | No | Ask for fewer ads than the placement allows. It can never raise the placement maximum. A negative value asks for no ads. |
placements[].filters | array | No | Product label filters. Groups are combined with AND, values inside a group with OR. Example: [["brand:acme"],["color:red","color:blue"]]. |
products | object[] | When listing pages | The products listed organically on the page, in page order, each with its category. GoWit uses them for relevance. On a product detail page put the viewed product first. Leave it out when the page lists no products (e.g. a homepage). |
products[].id | string | Yes | The product id you sent in the catalog push. Not the sku. |
products[].category | string | No | The product category as a text path, the same way it appears in retailer_taxonomy, e.g. Outdoor>Footwear. Used for relevance. |
products[].categories | string[] | No | Several category paths for a product listed in more than one category. |
search | string | When on search pages | The shopper's search query. Drives keyword targeting. |
category | string | When on category pages | The exact category path of the page, e.g. Outdoor>Footwear. |
category_id | string | No | Your own category code, accepted in place of category. When the code is unknown, category is used. |
page_number | integer | No | Results page, starting at 0. Lets ads continue in ranked order on page 2, 3, … Default 0. |
max_ads | integer | No | Default max_ads for every placement in this request. |
region_id | string | When on multi-region markets | Region of the shopper, for region targeting. Required when your market is set up per region. |
city_id | string | When on multi-city markets | City of the shopper. Required when your market is set up per city (or send customer.city). |
location_id | string | No | Store code. Stock and price are read for that store (see multi-location stock). |
language | string | No | ISO 639-1 language code of the page, e.g. en. Several codes may be separated by commas. |
customer | object | No | Shopper context. Every field is optional and a bad value is dropped, never refused. |
customer.customer_id | string | No | Your pseudonymous shopper id. Used for audience targeting and to attribute sales across sessions. Never send an e-mail address or phone number: values shaped like one are discarded. Placeholder values such as 0 or anonymous are ignored. |
customer.device_type | string | No | Device of the shopper, for markets with app or device rules. |
customer.environment_type | string | No | Environment of the shopper (e.g. app or web), for markets with app rules. |
customer.city | string | No | Shopper city. Can stand in for city_id on city-based markets. |
customer.user_agent | string | No | The shopper browser user agent. Known crawlers get no ad. |
customer.is_bot | boolean | No | Send true when your own bot detection flags the visit. The request gets no ad (204). |
Shape
{
"domain_id": 1001,
"session_id": "ec07083a-8bf812",
"placements": [
{
"placement_id": 1,
"placement_identifier": "<placement_identifier>",
"max_ads": 0,
"filters": "<filters>"
}
],
"products": [
{
"id": "P30001",
"category": "Outdoor>Footwear",
"categories": []
}
],
"search": "hiking boots",
"category": "Outdoor>Footwear",
"category_id": "<category_id>",
"page_number": 0,
"max_ads": 0,
"region_id": "<region_id>",
"city_id": "<city_id>",
"location_id": "<location_id>",
"language": "<language>",
"customer": {
"customer_id": "<customer_id>",
"device_type": "<device_type>",
"environment_type": "<environment_type>",
"city": "<city>",
"user_agent": "<user_agent>",
"is_bot": true
}
}