Organic add-to-cart events
Definition
Although the API request works exactly like any other page type, add-to-cart
is not an actual page view.
It is used when the product card on pages other than PDPs allows adding products to the cart (e.g., add-to-cart
button on search results).
This event is used to train the keyword model for each retailer. It will not return any ads.
Parameters
event-type
event-type
Value: addToCart
Description: Indicates to the API that this is an add-to-cart event.
Required: Yes
page-id
page-id
Description: Use the same page-id
where the add-to-cart event is happening (e.g., if it's on a search page, use viewSearchResult_API_mobile
or viewSearchResultApiMobile
).
Required: Yes
page-uid
page-uid
Description: This value is returned within the response of the initial call made on page load. By storing this value and including it in this subsequent add-to-cart event call, Criteo is able to link the event to the initial ad request.
Example: 58d1ebf6-543e-4285-b9dce2f772d1f18f
Required: Yes
item
item
Description: SKU ID corresponding to the product being added to the cart. Only one item is allowed.
Example: 123-ab
Required: Yes
parent-item
parent-item
Description: Only use this if parent SKUs are being passed (e.g., SKU for the t-shirt when the item sent is a particular size & color). Here, also, only one value is allowed.
Example: 123
Required: Recommended if the eCommerce platform uses parent items.
price
price
Description: Current price of the product added to the basket (with discount, if any).
Example: 34.99
Required: Yes
quantity
quantity
Description: The quantity of the item that was added to the cart.
Required: Yes
Sample calls
The header values in the sample calls are illustrative. Make sure to replace them with the appropriate values for your implementation.
Add-to-cart event example (AMER)
curl -X GET "https://d.us.criteo.com/delivery/retailmedia" \
--data-urlencode "criteo-partner-id=12345" \
--data-urlencode "environment=d" \
--data-urlencode "retailer-visitor-id=a1b2c3d4e5" \
--data-urlencode "customer-id=123456789" \
--data-urlencode "page-id=viewSearchResult_API_mobile" \
--data-urlencode "event-type=addToCart" \
--data-urlencode "page-uid=58d1ebf6-543e-4285-b9dce2f772d1f18f" \
--data-urlencode "item=123-ab" \
--data-urlencode "price=34.99" \
--data-urlencode "quantity=1" \
-H "Referer: https://www.criteo.com" \
-H "X-Forwarded-For: 123.456.789.012" \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
Add-to-cart event example (EMEA)
curl -X GET "https://d.eu.criteo.com/delivery/retailmedia" \
--data-urlencode "criteo-partner-id=12345" \
--data-urlencode "environment=d" \
--data-urlencode "retailer-visitor-id=a1b2c3d4e5" \
--data-urlencode "customer-id=123456789" \
--data-urlencode "page-id=viewSearchResultApiAios" \
--data-urlencode "event-type=addToCart" \
--data-urlencode "page-uid=58d1ebf6-543e-4285-b9dce2f772d1f18f" \
--data-urlencode "item=123-ab" \
--data-urlencode "price=34.99" \
--data-urlencode "quantity=1" \
-H "Referer: https://www.criteo.com" \
-H "X-Forwarded-For: 123.456.789.012" \
-H "User-Agent: app_ios 1.2.3"
Updated 3 months ago