Skip to content

DataLayer

The dataLayer is the contract between your website and your analytics tools. Every piece of tracking data — product impressions, cart actions, conversions, custom interactions — travels through it. Get the contract right and your analytics becomes a reliable foundation for business decisions. Get it wrong and you’re building dashboards on sand.

This section covers everything from naming conventions to platform-specific implementations. Whether you’re designing a new tracking specification, implementing GA4 ecommerce events, or validating what you’ve already built, you’ll find the definitive reference here.

Design your dataLayer right from the start. These articles cover the naming rules, data types, and versioning strategies that determine whether your implementation scales or collapses under its own complexity.

The GA4 ecommerce event specification defines a funnel from product discovery to purchase. Each event in this section maps directly to a stage in that funnel and connects to the next. Implement them in order — view_item_list feeds select_item, which feeds view_item, which feeds the cart and checkout events, which feed purchase.

Beyond ecommerce, you’ll need events that reflect your specific product interactions. These articles cover the standard patterns for authentication, search, forms, content engagement, and errors — plus a guide to designing your own events from scratch.

Platform-specific implementation guides. Each covers the quirks, hooks, and patterns specific to that platform — from Shopify’s Custom Pixels sandbox to WooCommerce’s AJAX cart to Next.js App Router route tracking.

Bad data in equals bad decisions out. These articles cover every layer of the validation stack — from TypeScript compile-time checks to runtime Zod schemas to automated Playwright tests running in CI.