Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
This page documents the tracking events available for theme developers to call manually.
window.zidTracking.zidTracking.sendGaSelectItemEvent(params)| Platform | Event Name | Sent |
|---|---|---|
| GA4 | select_item | Yes |
| GTM | select_item | Yes |
| GA Universal | ec:setAction click | Yes |
| Parameter | Type | Required | Description |
|---|---|---|---|
product | object | Yes | The product object |
listName | string | No | Name of the list (defaults to "products") |
listId | string | No | Identifier for the list |
index | number | No | Position of the product in the list (0-based) |
zidTracking.sendGaCartDetailViewedEvent(params)Important: This event is automatically fired on the cart page. Do not call it on the cart page to avoid duplicate events.
| Platform | Event Name | Sent |
|---|---|---|
| GA4 | view_cart | Yes |
| GTM | view_cart | Yes |
ViewCart | Yes |
| Parameter | Type | Required | Description |
|---|---|---|---|
cart | object | Yes | The cart object |
| Event | Function | When to Use |
|---|---|---|
select_item | sendGaSelectItemEvent | User clicks a product in a list |
view_cart | sendGaCartDetailViewedEvent | Cart viewed outside cart page (mini-cart, drawer) |