● Ecommerce Tracking

Ecommerce DataLayer Design and Implementation

The dataLayer is the contract between your store and every tracking tag. We write a GA4-standard ecommerce specification, work with your developers to implement it, and validate each push so GA4, Google Ads and Meta all read the same product and order data.

Ecommerce DataLayerIllustrative
  1. Store Code
  2. DataLayer Push
  3. GTM Variables
  4. Platform Tags
  5. Validation
What this covers
  • Written dataLayer specification
  • GA4 ecommerce event schema
  • Consistent item IDs across platforms
  • Push-by-push validation
Platforms
Google Tag ManagerGoogle Analytics 4Google AdsMeta PixelMerchant Center
Best for

Custom, headless or heavily customized stores with an in-house or agency dev team

01 The problem

When the DataLayer Is an Afterthought

Without a defined dataLayer, tags scrape prices from the page, IDs differ between platforms, and every redesign breaks something. The fix starts with a clear spec.

  1. 01

    Scraped Values From the Page

    Tags that read prices and names from HTML break when the layout changes and often pick up formatted text instead of numbers.

  2. 02

    Mismatched Product IDs

    GA4 gets a SKU, Meta gets a variant ID and the Merchant Center feed uses something else, so catalog and remarketing data do not line up.

  3. 03

    No Shared Definition

    Developers and marketers each guess what an event should contain. Without a spec, fixes are slow and regressions go unnoticed.

02 What we implement

What Goes Into Your Ecommerce DataLayer

We define the full ecommerce event set with exact parameter names, types and example payloads, then help your developers build it and verify each event before any tags depend on it.

  • 01

    GA4 Ecommerce Event Spec

    view_item_list, select_item, view_item, add_to_cart, begin_checkout, purchase and more, with example JSON.

  • 02

    Items Array Standard

    item_id, item_name, item_brand, item_category, item_variant, price, quantity and discount defined per item.

  • 03

    Product ID Alignment

    One ID rule that matches your Merchant Center feed and Meta catalog, so remarketing and reports connect.

  • 04

    Ecommerce Object Clearing

    An ecommerce: null push before each event so items from a previous event never carry over.

  • 05

    User and Order Context

    Transaction ID, currency, tax, shipping, coupon and hashed customer fields where consent allows.

  • 06

    GTM Variable Layer

    Data Layer Variables and reusable tag templates that read the spec directly, with no page scraping.

03 Live data flow

How the DataLayer Connects Store and Tags

Your store writes structured data once. GTM reads it and each platform tag formats it the way that platform expects.

Ecommerce DataLayer data flowIllustrative
  1. 01Store CodeFrontend or backend emits the event
  2. 02DataLayer PushEvent name plus ecommerce object
  3. 03GTM VariablesRead items, value and transaction ID
  4. 04Platform TagsGA4, Google Ads and Meta formats
  5. 05ValidationEach push checked against the spec
04 How it works

From audit to validated data.

How Ecommerce DataLayer projects run. Nothing goes live until it has been tested.

  1. 01

    Audit

    Audit existing dataLayer pushes, scraped variables and product ID usage across tags

  2. 02

    Strategy

    Write the ecommerce dataLayer spec with parameters, types and example payloads

  3. 03

    Implementation

    Support developers during the build and set up GTM variables and platform tags

  4. 04

    Testing

    Test every event on staging and production, including edge cases like variants

  5. 05

    Validation

    Confirm payloads match the spec in GA4 and ad platforms and log the results

05 Deliverables

What's Included in Ecommerce DataLayer

Everything is documented and handed over, so your team knows exactly what was built and why.

  • 01

    DataLayer Specification

    A developer-ready document listing each event, when it fires, every parameter and an example payload.

  • 02

    Product Data Mapping

    A mapping of store fields to GA4 item parameters and to Meta and Google Ads catalog identifiers.

  • 03

    Developer Support

    Direct answers for your developers during the build, including code review of the dataLayer pushes.

  • 04

    GTM Variables and Tags

    Variables, triggers and tags built on the finished dataLayer for GA4, Google Ads and Meta.

  • 05

    Event Validation Log

    A record of each event tested, the payload observed and whether it matched the spec.

  • 06

    Change Guidelines

    Simple rules for adding new events or parameters later without breaking existing tags.

Platforms

The tools involved in a typical Ecommerce DataLayer implementation.

  • Google Tag ManagerData Layer Variables
  • Google Analytics 4Ecommerce schema
  • Google AdsCart data conversions
  • Meta PixelCatalog content IDs
  • Merchant CenterProduct feed IDs
06 QA and testing

Tested before anything goes live.

Test every event on staging and production, including edge cases like variants. Confirm payloads match the spec in GA4 and ad platforms and log the results.

QA checklistEcommerce DataLayer
  • Test ordersTest purchases placed through the live checkoutchecked
  • dataLayer inspectionItems, value, currency and transaction_id on every stepchecked
  • Platform debugGA4 DebugView, Tag Assistant and Meta Test Eventschecked
  • ReconciliationPlatform revenue compared with store orderschecked

Each check is repeated after launch on live traffic.

07 FAQ

Ecommerce DataLayer FAQ

Something else? Talk to GrowthUper

We are on Shopify or WooCommerce. Do we need this?

Those platforms have their own tracking paths, which our Shopify and WooCommerce services cover. A standalone dataLayer project is most useful for custom, headless or heavily modified stores where a developer controls the frontend.

Who writes the dataLayer code?

Usually your developers, working from our specification. We answer questions, review their code and test the result. If you do not have a developer, we can write the pushes ourselves where the stack allows it.

Why follow the GA4 ecommerce schema?

GA4 reports read those exact parameter names. Google Ads and many GTM templates also expect them. Using the standard means less mapping work and fewer surprises when you add a new platform.

How do you handle product variants?

We agree on whether item_id is the parent product or the variant, then use item_variant for the other. The choice is matched to your Merchant Center and Meta catalog IDs so remarketing and reporting connect.

Does a dataLayer work with headless or single-page stores?

Yes. Single-page apps need virtual page views and pushes tied to route changes and component actions instead of page loads. We write the spec with those triggers in mind.

→ Next step

Get Ecommerce DataLayer right the first time.

Build a tracking and measurement system you can trust.

Get Free Tracking Audit Talk to GrowthUper Free 30-minute review · No obligation
Scroll to Top