GA4 with server-side purchases
ROASaurus sends GA4's recommended ecommerce events from the server through the Measurement Protocol, so purchases blocked in the browser still reach GA4, tied to the visitor's GA4 session when the storefront could read it.
| Google Analytics 4 at a glance | |
|---|---|
| Connection | Measurement Protocol with your measurement id and API secret |
| Events | page_view, view_item, add_to_cart, begin_checkout, purchase, refund, generate_lead |
| Session | The visitor's _ga client id and GA4 session id when the storefront read them |
| Consent | Consent Mode v2: ad_user_data and ad_personalization follow the visitor's choice |
| Extras | gross_profit, predicted_ltv and customer_type parameters (consented shoppers) |
| Free plan | GA4 is included on the Free plan |
What ROASaurus sends to GA4
The recommended ecommerce events, with value leaving out tax and shipping as GA4 asks. The client id is the visitor's _ga cookie when the storefront read it, so the purchase joins the visitor's session; otherwise a stable id of the same shape. Without confirmed consent the event is anonymous: no user id, user data, IP or user agent, and an id derived from the order alone. GA4 accepts Measurement Protocol events up to 72 hours old.
Profit and customer type in GA4
For consenting shoppers, a purchase can carry the order's contribution margin as gross_profit, a new customer's predicted 12-month value as predicted_ltv, and customer_type new or returning. Register the first two as custom metrics in GA4 to report on them.
GA4 in ROASaurus
ROASaurus can also read GA4 (sessions, users, key events) into its channel reports and warehouse exports, and Ask AI can answer from it. Reading GA4 waits for Google's OAuth verification of ROASaurus.
Related
What ROASaurus does with Google Analytics 4
- Sends page_view, view_item, add_to_cart, begin_checkout, purchase, refund and generate_lead through the Measurement Protocol.
- Joins the visitor's GA4 session when the storefront read the _ga cookie.
- Adds gross_profit, predicted_ltv and customer_type for consenting shoppers.
- Reads GA4 into the channel reports and warehouse exports (waiting for Google's OAuth verification).
Status today: Built from Google Analytics 4's official API documentation and tested against simulated responses. It has not carried a customer's traffic yet, so check the first deliveries in the Event log.
Waiting for an outside step: Reading GA4 into ROASaurus's reports waits for Google's OAuth verification. Sending events works today.
How it works
Find your keys
In GA4, copy the measurement id (G-…) and create a Measurement Protocol API secret.
Add the GA4 pixel
Paste both on the GA4 card under Tracking & platforms.
Decide who sends purchases
Turn off the purchase event in your own GA4 tag, so GA4 gets one copy.
Check DebugView
Place a test order and look for it in GA4 and in the Event log.

Set it up
The step-by-step guide, with the screens, the settings and what to check afterwards, is in the help centre: set up Google Analytics 4.
Questions about Google Analytics 4
- Does GA4 replace Shopify's Google channel?
- No. Keep whichever tag loads GA4 for page tracking; ROASaurus adds server-side ecommerce events.
Will GA4 count purchases twice?
If GA4's own tag also sends the purchase, yes. Send purchases from one place: turn off the purchase event in your GA4 tag, or leave GA4 out of ROASaurus.
Does it work without consent?
With Respect visitor consent on, events of visitors who declined are anonymous: no user id, user data, IP or user agent.
Is GA4 on the Free plan?
Yes. The Free plan, up to 100 orders a month, sends server events to Meta, Google Ads, GA4 and TikTok.
Every sale, traced to the ad that earned it
Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.