Skip to content

Consultor de Marketing Digital

Menu

Measure · Data layer

A well-designed data layer as the foundation of your tracking

The data layer is the contract between your store and your measurement tools. Done properly, GA4, Google Ads and Meta all receive the same data in the same format, and tracking stops breaking every time the theme changes.

In short

I design and implement the data layer architecture for WooCommerce stores: the data structure the store exposes to Google Tag Manager on every page and action. I write the specification for events and for product, basket, user and transaction objects, and see the implementation through via plugin or custom code. It is for stores with custom themes, modified checkouts or tracking that relies on scraping what is on screen.

What happens without a solid data layer

  • Tracking that scrapes the page

    Tags pulling prices and product names out of the HTML. Change the theme, a button or a CSS class and the data disappears or goes wrong.

  • A different format for every platform

    GA4 gets variation IDs, Meta gets SKUs and Google Ads gets yet another identifier. Catalogue, remarketing and reports stop lining up.

  • Custom checkouts with no data

    One-page checkouts, upsell plugins or extra steps that push nothing to the data layer. The most important stages of the funnel go dark.

How I design the data layer

I work from the measurement plan and each platform's needs to define a single specification, aligned with the GA4 ecommerce schema. I decide where data should be generated, in the plugin, the theme or on the server, and document every event with examples for whoever builds it.

  • A specification aligned with the GA4 ecommerce schema and extendable to Google Ads and Meta.
  • A product identifier consistent with the Merchant Center feed and the Meta catalogue.
  • Page, user and transaction data exposed without personal information in plain text.
  • Coverage for custom checkouts, variations, coupons and upsell plugins.

What you get

  • Data layer specification

    A document listing every event, its parameters, data types, JSON examples and the pages or actions where it should fire.

  • Identifier map

    One rule for product and variation IDs, aligned across WooCommerce, the feed and the ad platforms.

  • Implementation or technical brief

    Set-up via GTM4WP and theme adjustments, or a brief ready for your developer to build from.

  • Validation tests

    Checks of every event across product types, coupons and payment methods.

How it works

  1. Discovery

    I review the theme, checkout, plugins and current data layer, and gather each platform's requirements.

  2. Specification

    I write the full specification and review it with you and whoever develops the site.

  3. Implementation

    I build it or oversee the build, in a staging environment wherever possible.

  4. Validation and documentation

    I test every purchase scenario and hand over final documentation for future maintenance.

Tools I use

  • Google Tag Manager
  • GTM4WP
  • GA4
  • Tag Assistant
  • Chrome DevTools
What exactly is the data layer?

It is a JavaScript object on the page where the store places structured information, such as the product being viewed, what is in the basket or the order details. Google Tag Manager reads that object and sends the data to your tools, without depending on how the page looks.

Doesn't GTM4WP handle this on its own?

GTM4WP provides a fairly complete ecommerce data layer for standard WooCommerce and is often the starting point. Custom checkouts, upsell plugins or specific identifiers may need adjustments or extra events.

What personal data can go into the data layer?

As little as necessary, handled carefully. Data such as email addresses should only be used, for example for enhanced conversions, where there is a lawful basis and consent, and ideally hashed before being sent to the platforms.

Related tools

Some links are affiliate links: if you sign up, I may earn a commission at no extra cost to you. It never changes my assessment. How this works

Related articles

Does your tracking break whenever the site changes?

Book a discovery call. We will look at how data is being collected today and whether a dedicated data layer makes sense for you.

Newsletter

Practical notes for WooCommerce stores