addToCart events manually to Depict, or automatically by marking add-to-cart buttons in the DOM using the depict-add-to-cart class. The automatic tracking is limited to one product id per product detail page and product card. If your website uses size and color selectors before adding to cart, the imperative tracking is more reliable.
Sending add-to-cart events imperatively
Use the same variant-level
product_id that our API returns in the displays
ā the same id vocabulary as setProductId.
See Which ID goes where.addToCart event with the corresponding product id. If you implement imperative tracking, skip the automatic tracking section below.
depict-add-to-cart class to all add-to-cart buttons on your website, including product cards and product detail pages. Depict will automatically track clicks as necessary, using the product id set on product detail pages or result id for buttons inside product cards.
HTML

