Tracking & Analytics
Tracking & Analytics
How Car Battery Pro tracks customer events into Google Tag Manager.
Tracking & Analytics
🛠 Dev (👤 Ops: useful background)
Car Battery Pro tracks customer behaviour using a Shopify Custom Web Pixel that loads Google
Tag Manager and forwards events into the dataLayer. Both standard Shopify ecommerce events and
CBP's own cbp:* events flow through it.
- GTM container:
GTM-T7Z4P3GQ - Pixel source:
web-pixel.js(in the repo root) - Custom events: published from theme code via
Shopify.analytics.publish(...)(seeassets/analytics.js) and picked up by the pixel.
Setup
The contents of web-pixel.js are pasted into the Shopify admin under
Settings → Customer events → Add custom pixel. This is the only place the pixel lives; it is
not injected by the theme.
Pages in this section
- Data layer contract — the full reference: event shapes, fields, the
cbp:*event catalogue, and GTM variable/trigger guidance. - Verifying tracking — how to confirm events are firing.
The data-layer contract page reproduces the canonical TRACKING.md from the repository so it
renders here. If you change tracking, update TRACKING.md and keep that page in sync.