Send Shopify purchases to Google Analytics 4 with the Measurement Protocol
By the HonestTag team ยท Published October 16, 2026
HonestTag sends each verified Shopify purchase, and each refund, to your Google Analytics 4 web data stream from its server through Google's Measurement Protocol. The purchase carries your Shopify order ID as the transaction ID and goes under the client ID your Google Analytics tag set for the shopper when HonestTag's pixel saw it, so a blocked or missed browser purchase tag does not cost you the sale in GA4. You connect it with two values from Google Analytics: the Measurement ID of your web stream and a Measurement Protocol API secret. This page lists what you need, the exact steps, what is sent, and how to check it works.
What you need
- A Google Analytics 4 property with a web data stream, and the Google Analytics tag already running on your store. Google says the Measurement Protocol is meant "to augment automatic collection through gtag, Tag Manager, and Google Analytics for Firebase, not to replace it." When HonestTag's pixel saw the client ID that tag set in the shopper's browser, purchases are sent under it and join the visit; otherwise HonestTag sends a stand-in ID that joins no GA4 user or session.
- The stream's Measurement ID. Google's send events guide says it "identifies your web stream. It is not the same as your Stream ID. It usually starts with G-." HonestTag accepts only a web stream ID that starts with G-.
- A Measurement Protocol API secret for that stream. Google's API secrets page says you need the Editor role or above at the property level to generate API secrets, and "You can generate up to 10 API secrets per data stream." Create one for HonestTag so you can delete it on its own later.
- A paid HonestTag plan for delivery. The free Mirror never sends conversions anywhere. You can save the Measurement ID and the secret on the Mirror, and HonestTag starts sending purchases when you move to a paid plan. Google Analytics 4 takes one of your plan's delivery destinations. See pricing.
Connect Google Analytics 4, step by step
- Copy the Measurement ID. In Google Analytics, click Admin in the lower left. Under Data collection and modification, click Data streams, select your web data stream and copy the Measurement ID from the Stream details panel. It usually starts with G-.
- Create a Measurement Protocol API secret. On the same web stream, click Measurement Protocol API secrets. If Google asks, review and accept the User Data Collection Acknowledgement. Click Create, enter a nickname such as HonestTag, click Create, and copy the secret value. You need the Editor role or above on the property.
- Open the Google Analytics 4 card. In your Shopify admin, open the HonestTag app, go to Setup, and on the Google Analytics 4 card choose Paste Measurement ID and API secret.
- Paste and save. Paste the Measurement ID and the API secret and click Save and send a test event. HonestTag checks the test event with Google's validation server first and saves nothing if Google reports a problem.
- Look for the test event, then a real order. In Google Analytics, open Reports > Realtime or DebugView and look for the event
ht_setup_check. After your next online order, look for itspurchaseevent in Realtime.
What the save checks: HonestTag first posts the test event to Google's validation server, which "provides detailed messages about any issues found", with the field path, a description and a validation code. If Google lists a problem, nothing is saved. Then it sends the same event, ht_setup_check, once for real with debug mode on, and stores the secret encrypted. What it cannot check: Google says "The validation server does not validate the api_secret or measurement_id" and the Measurement Protocol "does not return HTTP error codes, even if an event is malformed or missing required parameters." A wrong secret is accepted without an error, so the card never calls the connection verified and asks you to look for the test event instead. To change the stream or rotate the secret, paste both values again; they are saved together.
HonestTag has also built a Google sign-in for this card that creates the API secret for you, after you tick Google's user data collection acknowledgement, and marks the four purchase events as key events. It is not switched on yet. Until the card offers a Google sign-in, connect with the paste steps above.
The four purchase goals in Google Analytics 4
GA4 has no conversion objects to create ahead of time: it records an event name the first time it receives it. Each order reaches your stream as up to three events:
purchase: every order (HonestTag's All Purchases goal). Google markspurchaseas a key event by default on web streams.ht_purchase_nc: new customers.ht_purchase_rc: returning customers.ht_purchase_fcnc: new customers whose first recorded ad click was on a Google ad. An FCNC order is sent as bothht_purchase_ncandht_purchase_fcnc.
To report on the three ht_ events as key events, mark them yourself. Google's key events page says: "If Google Analytics has already received an event from your website or app, you can mark the event as a key event. New events, on the other hand, might not show up right away, but you can still mark them as key events ahead of time" so that Google Analytics treats them as key events once they arrive. In Admin, under Data display, click Events, then either star an event that is already listed or use + Create event with Mark as key event turned on. Google allows up to 30 key events on a standard property. For how the four goals work on the ad platforms, see the HonestTag conversion actions.
What HonestTag sends to Google Analytics 4
For each eligible order HonestTag sends one request to www.google-analytics.com/mp/collect with your Measurement ID and API secret. The request holds:
- The client ID your Google Analytics tag set for this shopper, which HonestTag's pixel read from the tag's
_gacookie on your storefront. Google says "The client_id should match the ID generated by the Google Analytics tag on your website." When HonestTag never saw that cookie for the visitor, it sends a stand-in ID derived from its own random visitor ID and counts each time it does. - The order time as the event timestamp.
- One
purchaseevent with your Shopify order ID astransaction_id, the currency, and the value without tax and shipping, as Google asks ("Set value to the sum of (price * quantity) for all items in items. Don't include shipping or tax."). The order's shipping goes in the separateshippingparameter. Up to 20 products go initems: product ID, title, quantity and unit price in your shop currency. A custom line item with no product ID is sent by its title. If you turned on new and returning customer status for Google in HonestTag, the event also carriescustomer_type, only when HonestTag knows the answer. - One goal event per goal the order counts toward, as listed above, each with the same transaction ID, the currency and the order value before tax.
HonestTag sends GA4 no email address, phone number, IP address or user agent, and no user_id. It sends no consent field, and Google's reference says "If you don't specify consent, Google Analytics uses the consent settings from corresponding online interactions for the client or app instance." The consent rules HonestTag applies before any delivery are on the server-side delivery page: for EU, EEA, UK and Swiss orders a conversion with no visitor record is not sent. A bundle is sent as one product.
Google says events "can be backdated up to 72 hours". An older one is accepted with its timestamp moved to 72 hours ago. HonestTag does not send a purchase that is more than 72 hours old at send time, so an order never lands on the wrong day in your reports.
What HonestTag reads, and what it never touches
- Reads: nothing from Google Analytics. GA4 has no ad spend, so it does not appear in The Gap; HonestTag compares ad platforms' spend and claims with your store's own orders.
- Writes: the
ht_setup_checktest event when you save, then purchase, goal and refund events to the one stream you chose. - Never touches: your tag settings, other events, key event settings, audiences, product links or property settings. A pasted secret is yours: HonestTag never edits or deletes it.
Avoid counting a purchase twice
Google's rule, from its transaction ID page: "Google Analytics deduplicates purchase events with the same transaction ID." It adds: "Transaction ID deduplication only works for data collected through web streams, not app streams." HonestTag's transaction ID is the Shopify order ID, the same on every retry. If your store already sends a GA4 purchase event to the same web stream, through a Shopify app, a theme snippet or Google Tag Manager, check which transaction ID it uses. With the same Shopify order ID, GA4 keeps one purchase. With any other ID, such as the order name, GA4 counts the order twice: turn one purchase source off for that stream. HonestTag's three ht_ events have their own names, so they never collide with another tool's purchase. The duplicate purchase events guide shows how to find every purchase source on a store.
Refunds, edits and which orders are sent
- Refunds: a full or partial refund goes to GA4 as a
refundevent with the same transaction ID, valued without shipping and tax, with any refunded shipping in theshippingparameter. - Order edits and upsells: GA4 takes a correction only as a refund, so an edit that lowers the order value is sent as a refund event. An edit that raises it is not sent; the order proof shows GA4 as not adjusted with the reason.
- Which orders: orders from your online store are sent. Point of sale orders and subscription renewals are not sent to Google Analytics 4; the first order of a subscription is an online store checkout and is sent. Orders from other apps and sales channels are kept out unless you switch them on, as described in which orders are sent.
How to check it works
- The test event. In Google Analytics, open Reports > Realtime and look at the "Event count by Event name" card, or open DebugView (Admin, under Data display). Look for
ht_setup_check. Google's verification guide says an event "must have a client_id that has already been used to send an event from gtag.js," and the test event is not tied to a real shopper, so if it does not show, check with a real order before you replace the secret. - A real order. After your next online order, look for
purchasein Realtime. HonestTag's events carry no session or engagement time, and Google says such events "may not be fully reflected in Realtime user counts," so check the event count card, not the active users count. - In HonestTag order proof. Open the order in the HonestTag app. The proof shows GA4 as a destination and its delivery status. Google's reference says "The Measurement Protocol returns a 2xx status code if the HTTP request is received," so for GA4 the status means accepted, not processed.
- On the card. HonestTag checks the connection from time to time against Google's validation server. A healthy card reads "Google Analytics answered the check. It does not confirm the API secret, so look for the ht_setup_check event in Realtime or DebugView."
Error messages and what to do
- "paste the Measurement ID of your web data stream. It starts with G-" The ID was empty or not a web stream Measurement ID. Google notes the Measurement ID "is not the same as your Stream ID."
- "paste the Measurement Protocol API secret value exactly as Google Analytics shows it" The secret field was empty, too long, or had a space or line break in it. Copy it again.
- "Google Analytics rejected the test event (...). Nothing was saved" Google's validation server listed a problem. Its own description follows in the message.
- "the Google Analytics validation server answered HTTP ... Nothing was saved", "Google Analytics answered HTTP ... to the test event" or "Google Analytics did not answer ..." Google did not take the request. Try again in a minute.
- The test event never appears. The secret or the Measurement ID is wrong, or the secret was deleted. Create a new secret on the right stream and save again.
- A purchase more than 72 hours old. HonestTag does not send it, and the order proof records it as "reached us too late for the platform to accept it". That order is not in GA4.
- Reconnect needed. If Google answers a delivery or a check with HTTP 401 or 403, the card asks you to reconnect: paste the Measurement ID and a new secret.
Disconnecting
Disconnect from the Google Analytics 4 card, or uninstall the app. Sending stops and HonestTag deletes the stored secret. The API secret itself stays on your stream in Google Analytics: delete it there under Data streams, your web stream, Measurement Protocol API secrets.
Frequently asked questions
Do I still need the Google Analytics tag on my Shopify store?
Yes. Google says the Measurement Protocol is meant "to augment automatic collection through gtag, Tag Manager, and Google Analytics for Firebase, not to replace it." When HonestTag's pixel saw the client ID your Google Analytics tag set in the shopper's browser, the purchase is sent under that ID, so GA4 can join it to the visit. When it did not, HonestTag sends a stand-in ID instead: the purchase is still recorded, but it joins no GA4 user or session.
Will GA4 count a Shopify purchase twice?
It can. Google says "Google Analytics deduplicates purchase events with the same transaction ID." HonestTag's transaction ID is the Shopify order ID. If another tag or app also sends a purchase event to the same web stream with a different transaction ID, GA4 counts the order twice. Keep one purchase source per stream, or make sure both use the Shopify order ID.
Does HonestTag send refunds to Google Analytics 4?
Yes. A full or partial refund goes to GA4 as a refund event with the same transaction ID as the purchase, valued without shipping and tax, with any refunded shipping in its own field.
Are the HonestTag purchase events key events in GA4?
Google marks purchase as a key event by default on web streams. HonestTag's three goal events, ht_purchase_nc, ht_purchase_rc and ht_purchase_fcnc, are not key events until you mark them in Google Analytics Admin, under Data display, Events.
Why does HonestTag not say my API secret is verified?
Because Google gives no way to check it. Google says "The validation server does not validate the api_secret or measurement_id" and that the Measurement Protocol "does not return HTTP error codes, even if an event is malformed or missing required parameters." So HonestTag sends a test event and asks you to look for it in Google Analytics.
Does HonestTag send point of sale orders or subscription renewals to GA4?
No. Google Analytics 4 receives purchases from your online store. Point of sale orders and subscription renewals are not sent to it, and orders from other apps and sales channels are sent only if you switch them on in the app.
Related: every HonestTag integration, server-side delivery, first-click attribution, which decides the FCNC event, first-party tracking, and switching from another tracking app.