Other tools

Ready-made GTM container for GA4

Updated

ROASaurus offers one importable web container, for GA4: a Google tag for your measurement id and one GA4 event tag that sends each data-layer event with its ecommerce data and event id. Containers for Meta, TikTok, Microsoft UET or other platforms' tags are not available; ROASaurus loads those pixels itself.

Before you start

  • The data layer turned on: Settings › Store › Push storefront events to the data layer for Google Tag Manager; see The ROASaurus data layer.
  • A Google Tag Manager web container on your site.

Steps

  1. Download the container

    Under Settings › Store, click the GTM container link in the data-layer option.

    You should see: A file roasaurus-gtm-container.json. It holds the measurement id of your GA4 destination, or G-XXXXXXXXXX when the store has none.

  2. Import it

    In Tag Manager, open Admin › Import container, choose the file, pick your workspace and choose Merge (rename conflicting tags).

  3. Check the measurement id and publish

    Open the variable Const - GA4 measurement ID, replace the placeholder if needed, preview and publish.

    You should see: In preview, the tag GA4 - ROASaurus ecommerce events fires on view_item, add_to_cart and the other data-layer events.

What is in the container

  • GA4 - Google tag (ROASaurus) on all pages, with its own page view off (the data layer sends page_view).
  • GA4 - ROASaurus ecommerce events, firing on the trigger ROASaurus - data layer events, sending each event under its own name with the ecommerce object and event_id.
  • The variables DLV - event_id and Const - GA4 measurement ID.

Container or GA4 destination?

For ROASaurus's own tracking you do not need a container: the GA4 destination sends purchases from the server, and its option Also load the GA4 tag on the storefront sends the browser events. Use one of these paths for the browser events, not both, or GA4 counts them twice.

Common problems

Events reach the wrong GA4 property
The container took the measurement id of the first GA4 destination. Change the variable Const - GA4 measurement ID.
Page views doubled
Another Google tag on the site also sends page views. Keep one.

Still stuck? Email us.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.