Tracking & analytics · Coaching & education

GA4 e-commerce tracking with a custom data layer for a bespoke website

A custom-built site selling courses had no reliable purchase data. We wrote a JavaScript data layer for add-to-cart, checkout and purchase events, configured the tags and triggers in Tag Manager, and tested the full flow so GA4 now reports products, purchases and revenue accurately.

Industry
Coaching & education
Services
GA4 setup, Google Tag Manager, Custom data layer, E-commerce tracking
Pillar
Grow
GA4 e-commerce purchases report by item name
GA4 reports snapshot with total revenue
Custom HTML tag in Tag Manager containing the data layer code
Google Tag Manager tags for add to cart, checkout and purchase

The brief

The site was custom code rather than a standard platform, so no plugin could supply e-commerce events. GA4 showed sessions but not what was bought.

What we did

  • Wrote a custom data layer in JavaScript that pushes Add to Cart, Begin Checkout and Purchase events with item names, quantities, prices, value and transaction IDs.
  • Configured the GA4 configuration tag, event tags and triggers in Google Tag Manager.
  • Tested the complete flow in GTM Preview and GA4 DebugView before publishing.
  • Verified the e-commerce purchases report and revenue figures against real orders.

Outcome

GA4 now reports product, e-commerce, purchase and revenue data the client can trust, which is the foundation for every advertising decision that follows.

Free · 30 minutes · No obligation

Get results like this.

Book a free audit and we'll show you how we'd apply this grow playbook to your business.

  • Ads & tracking review
  • Store or funnel teardown
  • Automation opportunities