Other tools

Install ROASaurus with Google Tag Manager

Updated

Put the ROASaurus script tag in a Custom HTML tag that fires on all pages. Outside Shopify, Read purchases from the site’s data layer under Settings › Store then turns the purchase your thank-you page already pushes for Tag Manager into a ROASaurus purchase. A ROASaurus template in Google's Community Template Gallery is not available: the gallery reviews templates first.

Orders already come from your shop platform, so most stores do not need Tag Manager for ROASaurus. It helps when the script is easier to place through your container, or when your checkout runs somewhere ROASaurus has no plugin for (a third-party checkout, a site without a platform connection).

Steps

  1. Copy the script tag

    Open Connections › Tracking & destinations and copy the tag under Install.

  2. Add a Custom HTML tag

    In your web container, add a Custom HTML tag with the script tag, firing on all pages, and publish the container.

  3. Check it runs

    Open your store with ?roasaurus=connected.

    You should see: “ROASaurus is connected.”

  4. Read purchases from the data layer (outside Shopify)

    Under Settings › Store, tick Read purchases from the site’s data layer and save. The thank-you page must run the ROASaurus script and push its order as a GA4 purchase (ecommerce.transaction_id, value, currency, items), a Universal Analytics purchase or a gtag('event', 'purchase', …).

    You should see: After a test order, the purchase in Data quality › Deliveries with event id order-<transaction id>, counted once per order.

Profit for your server tags

A tag in your own server container can ask ROASaurus for the gross profit of the purchase it is about to send: POST /api/v1/profit with an API key that has the profit:read scope and { order_id, value, items: [{ variant_id, quantity }] }. The answer is { order_id, profit, source }: the order's own contribution margin when Profit has it, else the value minus each line's product and handling cost, else your store's margin ratio × the value. A ready server-side GTM variable that makes this call is not available; it would also go through the Community Template Gallery. See the API reference.

Shopify stores

On Shopify, install the app instead: it adds the script with the theme app embed and the checkout tag, and orders come from Shopify itself. The data-layer purchase option is for sites outside Shopify.

Common problems

A purchase is counted twice
Your platform connection or the orders API already sends the order. Use one source per order: leave the data-layer option off when the platform sends orders.
No purchase arrives from the thank-you page
The thank-you page does not run the ROASaurus script, or it pushes the order in another format. Open it with ?roasaurus=debug and check the console lines starting with [roasaurus].

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.