Only follow these steps for product cards that are NOT rendered through the
Depict UI (SDK)
We need to tell DPC about the product cards that you created using Depict data. Product cards rendered by Depict components (such as the SearchPage or RecommendationSlider) will automatically have this attached. However, if you render product cards yourself, you need to add a data attribute to the product card.
In the response from all our API:s there’s an id inside each display. You need to add this id to your product card template as a data attribute.
The ID is called different things based on different endpoints
This step enables DPC to track clicks on the product cards — including clicks on add-to-cart buttons inside them. Cards added later (for example after client-side navigation or infinite scroll) are picked up automatically.
Examples:
Category page:
Recommendations:
