Data Layer & Strategy

GA4 Ecommerce dataLayer Checklist: 9 Things to Check Before You Trust Your Purchase Data

Your GA4 revenue is off, the items report is half empty, or purchases show up twice. You’ve checked the GA4 settings and they look fine. Nine times out of ten, the fault is upstream, in the GA4 ecommerce dataLayer your site pushes before any tag fires.

With Black Friday and Cyber Monday days away, this is the cheapest moment to find it. Here are the checks I run on a Shopify, WooCommerce or custom checkout, in the order I’d run them. If your numbers already disagree with your shop, my 7-step purchase mismatch audit covers the GA4 side. This post covers the source.

Why the dataLayer is the first place to look

GTM and GA4 are faithful messengers. They send what the dataLayer contains. If the push has a price of “$24.00” as a string, or no items array, or fires twice, GA4 records exactly that. No setting inside GA4 will repair it afterwards.

GA4 ecommerce dataLayer flow: site push, GTM Custom Event trigger, GA4 event tag, GA4 reports
GTM and GA4 send exactly what the dataLayer contains, so check the push before any tag.

So I check the dataLayer first, before touching a tag. It takes ten minutes and rules out the most common causes.

How to inspect your dataLayer

Two ways, and I use both.

In the browser console, type dataLayer and press Enter on the page you’re testing. You’ll see every push so far, in order. To see them as they happen, open the console before you add to cart or check out.

In GTM, click Preview, enter your site URL, and click through a test order. The Tag Assistant summary lists each event on the left. Click one and open the Data Layer tab to see the state at that moment. Then check GA4 DebugView (Admin, DebugView) to confirm what arrived. Use a real test order, not a guess.

The 9 checks

1. Event names match GA4’s recommended ecommerce events

GA4’s ecommerce reports key off specific names: view_item_list, select_item, view_item, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase. A custom name like order_complete won’t populate the monetization reports. Either rename the push or map it in GTM to the right GA4 event name.

2. Clear the ecommerce object before every push

The ecommerce object persists in the dataLayer. If you push view_item and then add_to_cart without clearing, old items can leak into the new event. Push a null first:

window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: 24.00,
    items: [{
      item_id: 'SKU-1001',
      item_name: 'Canvas tote bag',
      price: 24.00,
      quantity: 1
    }]
  }
});

In Preview, click the second event and confirm no stale fields from an earlier push are sitting in the ecommerce object.

3. Every product has item_id, item_name, price and quantity

Open an item in the Data Layer tab and look at each one, not just the first. A common fault: the first product is complete, and later ones in a multi-item cart miss price or have an empty item_id. GA4 needs item_id or item_name at minimum, but I want all four, because revenue per product depends on price and quantity.

4. currency and value are present and numeric

currency must be a three-letter code like USD, GBP or CAD. value and price must be numbers. "$1,249.00" as a string is the classic failure, and it can give you zero revenue. Look for quote marks around the number in the console. If your platform outputs formatted strings, convert them before the push, or in a GTM Custom JavaScript variable as a fallback. Fixing it at the source is better.

5. transaction_id is unique and fires once per order

Every purchase push needs a transaction_id that matches the order number in your shop. Without it, GA4 can’t de-duplicate. Use the real order ID, not a timestamp or a random value, because you’ll want to reconcile against shop orders later. Place two test orders and confirm the IDs differ and match the confirmation emails.

6. The push happens before the tag that reads it

If your GA4 event tag fires on Page View or Initialization, but the dataLayer push comes later, the tag reads an empty object. Fire ecommerce tags on a Custom Event trigger that matches the event name (for example purchase), not on a page trigger. In Preview, the dataLayer event must appear in the timeline before the tag shows as fired on it. Also check that the GA4 event tag has “Send Ecommerce data” enabled with the Data Layer as the source.

7. Variants, discounts and coupons are mapped consistently

Pick one convention and keep it everywhere. Use item_variant for size or color, discount for the per-item discount amount, and coupon for the code. The usual mess is a variant that’s in the product name on the listing page and in item_variant at checkout, so the same product appears as two items in reports. Also keep item_id the same on every step. If it’s the SKU on the product page and the internal ID at checkout, funnel reports break.

8. Thank-you page reloads and back-button duplicates

A customer refreshes the confirmation page, or comes back to it from an email link. The purchase push fires again with the same transaction_id. GA4 does try to de-duplicate on that ID, but I don’t rely on it alone. Store the ID in a first-party cookie or localStorage after the first send and skip the push if it’s already there. Test it: complete an order, reload the thank-you page, and check Preview for a second purchase. I covered a similar problem in a Laravel de-duplication project.

9. The values reconcile with a real order

Finish with one test order where you know the numbers. Say you add two units of a $24.00 item and one $10.00 item, with $5.00 shipping and a $4.00 coupon. Decide in advance whether value should include shipping and tax, and apply that rule consistently. Then compare the dataLayer value to the order confirmation and to the event in DebugView. If all three agree, you can build on it.

What to do next

  1. Place a test order on your live or staging checkout with two different products.
  2. Run through checks 1 to 9 in GTM Preview and write down every failure.
  3. Fix the dataLayer at source (theme, plugin or backend) before editing GTM tags to compensate.
  4. Repeat the test order, confirm it in DebugView, then check the Realtime report.
  5. Do it again after any theme or plugin update, and before a big sale.

If you’d rather have someone else audit your checkout dataLayer before the sales start, I do this for Shopify, WooCommerce and custom builds. Get in touch with The GTM Guy and I’ll tell you what I’d fix first.