How to fix gtm audit on Headless / Custom (I build in code)

Install Google Tag Manager on your store and configure it to fire GA4 with full ecommerce event tracking (view_item, add_to_cart, purchase, and more).

Steps for Headless / Custom (I build in code)

  1. Add the GTM loader snippet to your root layout component (e.g. _document.tsx in Next.js or app.html in SvelteKit) so it fires on every page.
  2. Push ecommerce events to window.dataLayer manually or via a data layer helper library (e.g. @next/third-parties for Next.js includes a GTM component).
  3. Map each key user action (product view, add to cart, begin checkout, purchase) to the corresponding GA4 ecommerce event schema, including the items array.
  4. In GTM, create GA4 Event tags triggered by each dataLayer.push event name and publish.
  5. Use GTM Preview and GA4 DebugView to validate every event fires with the correct parameters.
Official Headless / Custom (I build in code) documentation ↗

What is gtm audit?

Google Tag Manager (GTM) is a free tool from Google that acts as a "container" on your website — it lets you install and manage tracking scripts (like Google Analytics 4, Meta Pixel, TikTok Pixel, and dozens more) without editing your store's code every time. Right now, no GTM container is detected on your site, which means you are almost certainly missing critical data about how shoppers find, browse, and buy from your store. GA4 ecommerce events are the specific signals (like "viewed a product," "added to cart," "completed a purchase") that GA4 needs to build reports you can actually act on.

Without GTM and GA4 ecommerce tracking, you are flying blind: you cannot see which marketing channels drive real revenue, which products are viewed but never bought, or where shoppers abandon your funnel. Google Ads Smart Bidding and Performance Max campaigns require conversion data from GA4 to optimise spend — without it, you are wasting ad budget. Retailers with proper ecommerce event tracking consistently find 15–30% of ad spend is going to non-converting channels that they only discover through data. Beyond advertising, GA4 audience data powers remarketing lists, personalisation, and Merchant Center signals that directly affect your Shopping and Search rankings.

See the complete Gtm audit guide for every platform and the full background.

Not sure if your Headless / Custom (I build in code) store has this?

Run a free SEOLZ scan — we’ll find gtm audit and every other issue across your whole site.

Scan my site free

Fix gtm audit on another platform