Analytics events
The app publishes customer events through Shopify’s Customer Events (Web Pixels). Subscribe to them in a custom pixel and forward them to Google Analytics or any other tool.
Coding knowledge needed
Setting up a custom pixel requires basic JavaScript knowledge. See Shopify’s documentation on custom pixels. We don’t provide support for third-party analytics tools: ask your developer or agency.
Set up a custom pixel
- In your Shopify admin, go to Settings › Customer events.
- Click Add custom pixel, give it a name, and paste your code.
- Save and Connect the pixel.
Inside the pixel, subscribe to the events below with analytics.subscribe. Event data is available in event.customData. See a complete example in Shopify’s documentation.
Events
| Event | Triggered when | Plan |
|---|---|---|
comparison_product_viewed | A customer clicks View details in a comparison table | All |
dynamic_comparison_product_added | A product is added to the dynamic comparison | Pro |
dynamic_comparison_product_removed | A product is removed from the dynamic comparison | Pro |
dynamic_comparison_modal_opened | The dynamic comparison dialog is opened | Pro |
Need another event? Tell us about your use case.
comparison_product_viewed
Published when a customer clicks the View details button of a product, in a comparison table or in the dynamic comparison dialog.
| Property | Description |
|---|---|
product.id | ID of the product. |
product.handle | Handle of the product. |
analytics.subscribe('comparison_product_viewed', (event) => {
console.log(event.customData.product.id, event.customData.product.handle);
});
dynamic_comparison_product_added
| Property | Description |
|---|---|
product.handle | Handle of the added product. |
analytics.subscribe('dynamic_comparison_product_added', (event) => {
console.log(event.customData.product.handle);
});
dynamic_comparison_product_removed
| Property | Description |
|---|---|
product.handle | Handle of the removed product. |
analytics.subscribe('dynamic_comparison_product_removed', (event) => {
console.log(event.customData.product.handle);
});
dynamic_comparison_modal_opened
| Property | Description |
|---|---|
products | Array of { handle } for the products being compared. |
analytics.subscribe('dynamic_comparison_modal_opened', (event) => {
event.customData.products.forEach((product) => {
console.log(product.handle);
});
});
Example: send events to Google Analytics 4
// Custom pixel — replace G-XXXXXXX with your measurement ID
const script = document.createElement('script');
script.src = 'https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX';
script.async = true;
document.head.appendChild(script);
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
analytics.subscribe('dynamic_comparison_modal_opened', (event) => {
gtag('event', 'compare_products', {
items: event.customData.products.map((product) => ({ item_id: product.handle })),
});
});
Privacy
Does this affect customer privacy? Shopify pixels respect customer privacy choices and don’t track visitors who opted out. Learn more.
Is data stored on your servers? No. Events are only sent through Shopify’s pixel system. We don’t collect or store them.
