LatchPay

Connections

Connect Google Analytics 4 (Measurement Protocol)

Step by step: copy your GA4 Measurement ID, create a Measurement Protocol API secret, list your store under unwanted referrals, and import the purchase into Google Ads.

Updated

What LatchPay sends to Google Analytics

Once connected, LatchPay's server sends Google Analytics 4 every paid order as a purchase, with the payment id as transaction id. The Google tag in the browser sends the same purchase, and Google Analytics keeps one per transaction id. The checkout steps (begin_checkout, add_payment_info) keep coming from the browser only, because Google Analytics cannot merge those when they arrive twice.

With the API secret saved, the checkout and the server use the same visitor id as your storefront, so the purchase joins the visit it came from. Server-side tracking explains the rest.

  • You need the Editor role on the Google Analytics property.
  • In LatchPay, open Settings → Tracking for the right store: ids and secrets are saved per store.

Connect Google Analytics, step by step

  1. Open Google Analytics

    Open Google Analytics and choose your store’s property. Open Google Analytics

  2. Open Admin

    Click Admin (the gear at the bottom left).

  3. Open Data streams

    Under Data collection and modification, click Data streams.

  4. Choose your web stream

    Click the web stream with your store’s web address.

  5. Copy the Measurement ID

    Copy the Measurement ID at the top of the stream details. It starts with G-, followed by about 10 letters and digits.

  6. Paste the Measurement ID

    Paste it into Measurement ID on the Google Analytics 4 card in LatchPay.

  7. Open API secrets

    Back in the same stream in Google Analytics, click Measurement Protocol API secrets.

  8. Accept the terms if asked

    If Google first shows Review terms, click it and then I acknowledge. Google asks this once per property before it lets you create an API secret.

  9. Create an API secret

    Click Create, type LatchPay as the nickname and click Create again. An API secret works like the access token of other platforms: a long code that works like a password and lets LatchPay send purchases to this stream.

  10. Copy the secret

    Copy the Secret value.

  11. Paste the secret

    Paste it into Measurement Protocol API secret on the Google Analytics 4 card.

  12. Save

    Click Save. The card now says Pixel + server.

LatchPay stores the secret encrypted and only ever shows its last four characters. To replace it, paste a new one and click Save.

Send a test event

  1. Send the test event

    Click Send test event on the Google Analytics 4 card.

  2. Open DebugView

    In Google Analytics, click Admin, then DebugView under Data display.

What you should see: Within a minute an event named latchpay_test shows up in DebugView. Google accepts events even with a wrong API secret, so seeing latchpay_test there is the real proof.

Before that event, LatchPay has Google's validation server check a purchase-shaped event; that one never shows in reports.

If it does not work: The API secret was made in another stream: create it in the stream whose Measurement ID you pasted. Or the Measurement ID has a typo: copy it again from the stream details.

Google accepts events even with a wrong API secret, so neither LatchPay nor Google can confirm the secret itself. For the same reason, "sent" on the card means Google's server accepted the event.

After your next order

  • The day after a real order, Reports → Monetization → Ecommerce purchases lists one transaction with its payment id, not two.
  • The purchase keeps the source of the visit (for example the ad), not your store as a referral.
  • The Google Analytics 4 card shows when LatchPay last sent a purchase; Sent · 7 days counts purchases only.

Still stuck?

Tell us what you see and which store it is about. We reply by email, usually within a day.

More in Connections