Other tools

The ROASaurus data layer for GTM

Updated

Tick Push storefront events to the data layer for Google Tag Manager under Settings › Store, and the storefront script pushes every storefront event to window.dataLayer in GA4's ecommerce format, with the event id ROASaurus sent the server. It is off by default.

Steps

  1. Turn it on

    Open Settings › Store, tick Push storefront events to the data layer for Google Tag Manager and save.

  2. Check the pushes

    Open your store in Tag Manager's preview mode, view a product and add it to the cart.

    You should see: The events page_view, view_item and add_to_cart in the preview, each with event_id and an ecommerce object.

  3. Use them in tags

    Build your own tags on these events, or import the ready GTM container for GA4.

What it pushes

Before each event the previous ecommerce object is cleared ({ ecommerce: null }), as Google asks. Then { event, event_id, ecommerce } for view_item, view_item_list, add_to_cart, remove_from_cart, view_cart, begin_checkout, search, add_to_wishlist, generate_lead and page_not_found, and page_view with the page type, market, country, currency and language. purchase is pushed on sites whose thank-you page runs the storefront script; Shopify's checkout does not run it.

event_id is the id of the matching server event, so a tag that sends the same event to a platform can be deduplicated against ROASaurus's server event.

Consent and personal data

Pushes follow your store's consent setting, like the browser pixels. No email, customer id or other identifier is pushed.

Common problems

Nothing is pushed
The option is off, the page does not run the ROASaurus script, or the visitor's consent does not allow it. Check with ?roasaurus=debug.
Events count twice in GA4
Your container sends them and the GA4 tag (or Shopify's Google channel) sends them too. Keep one sender per event.

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.