Tracking
Setting up Meta and GA4 with server-side purchases
Connect Meta and Google Analytics 4, send purchases from your server as well as the browser, and test that each one is counted once.
Before you start
- Switch off these platforms in any other tracking plugin or tag manager first. Two sources firing the same pixel double your numbers
- Have access to Meta Events Manager and to your Google Analytics property
- For purchase tracking, WooCommerce must be active
Meta
Meta uses the pixel in the browser and the Conversions API from your server. You need two values:
| Value | Where to find it |
|---|---|
| Pixel ID | Events Manager, Data sources, your pixel, Settings |
| Conversions API access token | Events Manager, your pixel, Settings, Conversions API, Generate access token |
- 1
Open Tracking
In the Swiftkeep sidebar, open Tracking, switch the module on and choose Meta.
- 2
Enter the pixel ID and the token
The token is encrypted before it is saved and is not shown again.
- 3
Test it
In Events Manager, open Test events and copy the test event code into the test field in Swiftkeep. Load a page on your site. The event should appear twice in Meta, once from the browser and once from the server, and be marked as deduplicated.
- 4
Clear the test code
Remove the test event code as soon as you finish testing. It is for testing only.
Google Analytics 4
GA4 uses the Google tag in the browser and the Measurement Protocol from your server.
| Value | Where to find it |
|---|---|
Measurement ID, in the form G-XXXXXXXXXX | Analytics, Admin, Data streams, your web stream |
| Measurement Protocol API secret | On the same data stream: Measurement Protocol API secrets, Create |
- 1
Choose Google Analytics 4
In Tracking, choose Google Analytics 4 and enter the measurement ID and the API secret.
- 2
Turn on test mode
Test mode marks events so they show in GA4's DebugView. The test button also checks an event against Google's validation server.
- 3
Check DebugView
In Analytics, open Admin, then DebugView, and load a page on your site.
- 4
Turn test mode off
Switch it off when the events look right.
If your data must be collected in the EU, turn on the option that sends server events to Google's EU endpoint.
Server-side purchases
With WooCommerce active, purchase events are sent from your server as well as from the browser. The server event is sent when an order reaches the Processing or Completed status, so an order is reported even if the customer closed the tab before the thank-you page loaded.
For Meta, both events carry the same event ID, and Meta uses it to recognise the pair as one purchase. GA4 does not merge events by ID, so the server purchase goes to GA4 only if the browser's has not arrived within ten minutes, by default. You do not need to configure either.
Consent
Google Consent Mode v2 is on by default, and events wait for the visitor's choice. A purchase made before the visitor answered is not sent from the browser or the server. You are responsible for collecting consent in the way the law requires where your visitors are.
Check a real order
- 1
Place a test order
Use a private window, so no ad blocker or admin session gets in the way.
- 2
Look at the event list
In Tracking, the purchase should be listed as sent from the browser and, for Meta, from the server.
- 3
Look at the order
If you accepted analytics cookies, the traffic source is stored with the order and feeds the attribution report.
Written for Swiftkeep 2.1.6. Under white label, the plugin shows your agency's name where this guide says Swiftkeep.