Data layer engineering · WordPress & WooCommerce

A WordPress and WooCommerce data layer built for accurate tracking

I build a structured DataLayer 2.0 framework for WordPress and WooCommerce: page_view and every e-commerce step push complete, consistent data with live values, ready for GA4, Google Ads, Meta and any other platform through GTM.

  • DataLayer 2.0 framework
  • page_view with context
  • Every e-commerce step
  • Ready for every platform

Why plugin data layers fall short

Many WordPress sites rely on a mix of plugins for tracking. Each one sends slightly different data, some steps are missing, and nothing is documented.

  • Purchases that fire twice on thank-you page reloads.
  • Prices sent as text, or without tax, shipping and discounts.
  • Checkout steps (shipping, payment) not tracked at all.
  • Logged-in user and page context missing, so segmentation is impossible.
DataLayer 2.0

The DataLayer 2.0 framework

One structured, documented data layer that every tag reads from, instead of each plugin guessing.

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: 59.00,
    items: [{
      item_id: 'SKU-123',
      item_name: 'Running Shoe',
      item_category: 'Shoes',
      price: 59.00,
      quantity: 1
    }]
  }
});

Consistent structure

Every event follows the same GA4-compatible format, so one set of GTM variables works for all platforms.

Live values

Prices, quantities, coupons and totals come from WooCommerce at the moment of the action.

Safe by default

The ecommerce object is cleared between pushes and purchases fire once per order.

E-commerce tracking

WordPress e-commerce tracking: every step with live values

Each event pushes the full GA4-compatible ecommerce object with item IDs, names, categories, variants, prices, quantities, coupon, currency and value, cleared between pushes to avoid stale data.

  1. 01 page_view Page view page type, user state
  2. 02 view_item Product view item ID, name, price
  3. 03 add_to_cart Add to cart item, quantity, value
  4. 04 begin_checkout Checkout start cart items, value
  5. 05 add_shipping_info Shipping step shipping tier, value
  6. 06 add_payment_info Payment step payment type, value
  7. 07 purchase Purchase order ID, revenue, tax

Values are injected dynamically from the page and checkout, so totals match your real orders. Event names above follow GA4 conventions as a reference; the final names and required properties always follow each destination platform's own specification.

Deliverables

What you get

  • DataLayer 2.0 specification for your site
  • page_view with page type, user state and content context
  • view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info and purchase with dynamic values
  • Duplicate purchase protection with transaction IDs
  • GTM variables and triggers ready for every platform
  • Developer documentation, plus a QA report
Process

How we work together

  1. 01
    Audit

    I review your current WordPress setup, tags, forms and data flows, and list what is missing or wrong.

  2. 02
    Plan

    You get a written tracking plan: events, values, identity and where each signal goes.

  3. 03
    Build

    I implement the plan on your site, server and integrations, without breaking existing tracking.

  4. 04
    Verify

    Every event is tested with real actions and compared with your store or CRM, then documented.

How I Work

My Proven 5-Step Working Process

A clear, tested process, so you know exactly what is being tracked, why, and that it works. Nothing goes live until it is tested against real conversions.

  1. Step 1: Free discovery call

    Free · 30 min

    We agree what counts as a real lead or sale for your business, which platforms you use and where the numbers stop adding up.

  2. Step 2: Tracking audit & measurement plan

    Step 1

    I audit your tags, GTM container, GA4, ad platform conversions and CRM, then write a tracking plan for you to approve before anything changes.

  3. Step 3: Build & connect

    Implementation

    GA4, Google Tag Manager, server-side tracking, Meta CAPI, enhanced conversions and CRM or offline imports are built and connected end to end.

  4. Step 4: Test & verify

    Before go-live

    Every event is checked in GTM Preview, GA4 DebugView and each ad platform's diagnostics, with deduplication and consent tested properly.

  5. Step 5: Handover & support

    Docs + video

    You get written documentation and a walkthrough video, and I stay on hand after launch to make sure the data keeps matching.

FAQ

WordPress questions

Do you build it as a plugin or theme code?

Usually as a small custom plugin or code snippets, so it survives theme updates and doesn't depend on third-party tracking plugins.

Does it work with WooCommerce block checkout?

Yes. Block-based and classic checkouts are handled, including the shipping and payment steps.

What about Shopify?

Shopify needs a different approach through its Customer Events. See the e-commerce data layer service for Shopify.

Let's get your WordPress tracking right

Tell me what you're tracking today and where the numbers don't add up. You'll get an honest assessment and a clear plan.