Is your GA4 data actually right? Get a fixed-price GA4 & GTM audit. Request an audit
noxtag
Free tool · Generator

Generate the dataLayer.push your developers need

Most broken GA4 ecommerce comes from a data layer that doesn't match Google's schema. Pick an event, fill in your fields and copy code that GTM and GA4 will read correctly.

Choose an event

1. Paste this where the action happens
2. Set up Google Tag Manager

    Why the format matters

    GA4 only fills its ecommerce reports when the data layer matches Google's schema exactly: an ecommerce object with value, currency and an items array. A price sent as a string, a missing currency or a reused ecommerce object from the previous event is enough to break revenue reporting.

    • Push { ecommerce: null } before each ecommerce event so values from the last one don't carry over.
    • Send numbers as numbers: 129.00, not "$129".
    • Fire purchase once, on the confirmation page or server response, with a unique transaction_id.

    More patterns and edge cases are in the data layer guide. Purchases missing in GA4? See why the purchase event isn't tracking.

    FAQ

    Where do I put dataLayer.push?

    In your site code at the moment the action happens: after the order is confirmed for purchase, when the item is added for add_to_cart, after a successful form submission for generate_lead. The Google Tag Manager snippet must be on the page.

    Why push ecommerce: null first?

    GTM merges data layer pushes. Clearing the ecommerce object stops items or values from a previous event leaking into the next one.

    Does this work with Shopify?

    Shopify's checkout runs in a sandbox, so purchase tracking there uses a custom pixel rather than a direct data layer. Our Shopify guide shows how.

    Found a problem you'd rather not fix yourself?

    We audit and fix GA4, GTM and consent setups at a fixed price.

    Request an audit

    More free tools

    All tools →