Docs

Docs › Platforms

Google Analytics 4

In the plugin: Tracking Nexus → Platforms → Google Analytics 4

On this page

Connect Google Analytics 4 (GA4) so your site's page views, shop activity, leads and purchases show up in your GA4 reports. Setup takes a measurement ID. Refunds and server-side purchases take one extra secret from Google.

What you need from Google first

  • Your measurement ID. It starts with G-. In Google Analytics, open Admin, then Data streams, then your web stream. Use the measurement ID, not the stream ID.
  • A Measurement Protocol API secret, only if you want refunds (or purchases) sent from your server. In the same stream, open Measurement Protocol API secrets and create one. Make one just for this site, so you can replace it without touching anything else.

Connect GA4

  1. Open Tracking Nexus → Platforms and choose GA4.
  2. Paste your ID into What is your GA4 measurement ID?
  3. Press Save. GA4 is now connected and the page shows a Connected badge.
  4. Under How should events reach Google Analytics 4?, leave From the browser only selected. The other choice, Through Google Tag Manager, is for sites where your own container sends GA4 (see Google Tag Manager and the data layer).
The Connection card on the Google Analytics 4 page, with the measurement ID field and the two ways events can reach GA4 (opens the full screen)
Tracking Nexus → Platforms → Google Analytics 4: the Connection card.

GA4 follows your visitor's analytics choice. Nothing goes to Google Analytics until your consent plugin (or your own code) says analytics is allowed. For how Google's own consent signals are written, see Google Consent Mode.

Choose the events GA4 receives

Open the Events tab. Every event has its own switch for GA4. This table shows what happens on your site and the GA4 event name it is sent under.

What happens on your site GA4 event
A page loads page_view
Someone searches your site search (off by default)
A visitor scrolls down a page scroll_depth
A visitor stays on a page time_on_page
A phone, email or messaging link is clicked contact
A file is downloaded file_download (off by default)
A link to another site is clicked outbound_click (off by default)
A visitor starts filling in a form form_start (off by default)
A product page or a shop or category page is viewed view_item, view_item_list
A product is added to or removed from the cart; the cart is viewed add_to_cart, remove_from_cart, view_cart
Checkout starts; shipping or payment is chosen begin_checkout, add_shipping_info, add_payment_info
A visitor creates an account or logs in sign_up, login
Your form plugin accepts a submission generate_lead (or sign_up for a form you mark as a sign-up)
A WooCommerce order is paid purchase
A WooCommerce order is refunded refund (from your server, see below)

Search, file downloads, outbound clicks and form starts start switched off for GA4 on new sites, because GA4's own enhanced measurement already records most of them and sending both would count each one twice. Switch one on only if you have turned that part of enhanced measurement off in Google Analytics. Your own custom events go to GA4 under the names you give them.

The Events tab of the Google Analytics 4 page: each event, where it comes from and its switch (opens the full screen)
The Events tab: one switch per event for GA4.

Refunds and purchases from your server

A refund happens after the visitor has gone, so only your server can report it. On the GA4 page, the Server events card lets you choose:

Choice What it does
No Nothing is sent from your server. Refunds are not reported to Google Analytics.
Refunds only Purchases come from the visitor's browser. Refunds come from your server. This is the recommended choice.
Refunds and purchases Purchases leave the browser and come from your server instead.

Google removes no duplicates between the browser and the server for GA4, so each purchase is sent one way only, never both. That is also why a failed server send is not repeated when the network answer was lost: GA4 would count it twice.

  1. Create the secret in Google Analytics (see above).
  2. On the GA4 page, choose Refunds only (or Refunds and purchases) under Send refunds and purchases from your server?
  3. Paste the secret into GA4 Measurement Protocol API secret and press Save.

A server event needs the visitor's own GA4 client ID, taken from their browser. If a visitor had no GA4 ID yet when they converted, that server event is not sent, and Activity says so, rather than creating a phantom visitor.

The Server events card on the Google Analytics 4 page (opens the full screen)
The Server events card.

Test it

  1. Visit your site in a browser where you have allowed analytics, then open GA4's Realtime report. Your visit appears there.
  2. For server events, switch on Test without recording under Advanced. Google then checks each server event and reports problems, but nothing shows in your reports.
  3. Send a test order or refund, then open Tracking Nexus → Activity. With test mode on, the row says Checked by Google in test mode; not recorded.
  4. Switch Test without recording off again when you have finished, or nothing will reach your reports.

Common problems

Purchases are counted twice. Another tool also sends GA4 purchases (a theme, Site Kit or a Tag Manager tag). See Duplicate conversions from other tracking plugins.

Refunds do not appear. Check that Send refunds and purchases from your server? is not No and that the secret is saved. Open the refund in Activity to read the reason.

Nothing shows in Realtime. Check consent first: a visitor who has not allowed analytics sends nothing. Nothing is reaching a platform walks through the rest.

Questions

Do I need the API secret to use GA4?

No. The measurement ID alone connects GA4 through the browser. The secret is only for refunds and for purchases sent from your server.

Can I send to more than one GA4 property?

Yes, up to five measurement IDs. See Use more than one pixel per platform.

Should I choose "Refunds only" or "Refunds and purchases"?

"Refunds only" is the recommended choice. Purchases stay in the visitor's browser and only refunds come from your server, so a purchase can never be counted twice.

Last updated 27 November 2026