Analytics Tag
One script, your API key — and your storefront starts emitting structured analytics events automatically.
What gets captured
- Pageviews and page-leave timing
- Product impressions, clicks, variant selections
- Add to cart, remove, quantity changes, wishlist
- Search, filter, sort
- Checkout funnel: started, coupon applied, completed
- Order placed, payment initiated / completed / failed
- Form errors and abandonment
- Engagement: scroll depth, time on page, rage clicks, dead clicks
- Web vitals: LCP, INP, CLS, FCP, TTFB
- JavaScript errors and slow API responses
- Feature flags & A/B experiments (variant served + exposure)
- Session replay (DOM playback, PostHog-backed)
- On-page surveys (NPS, ratings, free text)
- Conversion pixels: Microsoft Clarity + Facebook CAPI dedup
All without writing tracker calls — just add data-p-* attributes on the elements you already have.
Bundle size
analytics.min.js — 6.9 kB gzipped.
Next steps
- Quick Start — get the tag on a page in under a minute
- Tag attributes —
data-api-keyand friends - Auto-capture —
data-p-*conventions, with examples - JavaScript API —
track,identify,group - Configuration — every
init()option and toggle - Automated metrics — web vitals, errors, engagement
- Feature flags — flags & experiments
- Session replay — DOM session playback
- Surveys — on-page feedback forms
- Event reference — every event the tag knows
- Privacy & consent — DNT, opt-out, no PII auto-capture