Skip to main content

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 optimize bids. It will not return any ads.

Parameters

event-type

Value: addToCart Description: Indicates to the API that this is an add-to-cart event. Required: Yes

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

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: 545d9a70-f096-4568-b4b9-8f2f32a452d4 Required: Yes

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

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

Description: Current price of the product added to the basket (with discount, if any). Example: 34.99 Required: Yes

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)


Add-to-cart event example (EMEA)



What’s next