Other tools

Send events to server-side GTM

Updated

Add Server-side GTM as a destination with your container URL. ROASaurus posts each event to it in GA4 Measurement Protocol format, where the container's Measurement Protocol client turns it into event data for any server tag.

You do not need a server container for ROASaurus itself: it sends to the ad platforms from its own server. This destination is for teams that already route data through their own container and want ROASaurus's order-based events there too, for example to feed a tag ROASaurus does not have.

Only events with confirmed marketing consent are forwarded, because the container's tags can send them anywhere. Profit is not forwarded to server-side GTM yet; that is being built.

Before you start

  • A running server-side GTM container on your own domain (for example https://sgtm.yourshop.com).
  • A Measurement Protocol client in that container (its activation path, by default /mp/collect).
  • The owner or admin role in ROASaurus.

Steps

  1. Add a Measurement Protocol client

    In your server container, add a client that accepts GA4 Measurement Protocol requests and note its activation path.

  2. Add the destination

    In ROASaurus, open Connections › Tracking & destinations, find Server-side GTM under Analytics and data and click Add pixel. Enter the Container URL and, if it differs from /mp/collect, the Client path.

    You should see: The destination saved with the events you ticked: page views, product views, adds to cart, checkouts, purchases, leads and refunds can all go out.

  3. Add the optional fields

    Fill in the GA4 Measurement ID if your tags expect measurement_id (it also lets the scripts read the GA4 session cookie), and an API secret if your client checks one. Tick Send the shop customer id as user_id or Send hashed email, phone and address (user_data) if your tags use them.

  4. Test in preview mode

    In GTM, open Preview › Send requests manually, copy the X-Gtm-Server-Preview value into Preview header, save and place a test order.

    You should see: The ROASaurus events in the container's preview. Remove the preview header after testing.

What you should see

Data quality › Deliveries lists every forwarded event with status sent and the container's answer.

Common problems

“The container URL must start with https://.”
Enter the full address of your container with https, without a path.
Deliveries fail with 404
The client path does not match the client's activation path. Copy it from the client and save again.
Some purchases are missing in the container
Purchases of shoppers without marketing consent are not forwarded to server-side GTM.

Next step

Connect Google Analytics 4 directly

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.