Google Analytics 4 Integration
Connect Split Test Pro to GA4 with Google sign-in. Variant exposures flow into GA4 as events, and each variant gets its own GA4 audience for segmentation.
The GA4 integration pushes Split Test Pro’s variant assignment into Google Analytics 4 as a custom event, then auto-creates a GA4 audience per variant. Together this lets you slice your GA4 data by experiment exposure — see how variants performed on metrics GA4 tracks (engagement time, page paths, custom dimensions) but Split Test Pro doesn’t.
This integration works the same way on HTML and Shopify. The setup flow is identical.
What You Get
Once connected:
experience_impressionevent fires in GA4 every time a visitor is bucketed into a variant. The event includes a parameterexp_variant_stringformatted asSTP-{experimentId}-{variantId}.- One GA4 audience per variant, auto-created on the first activation. Audiences are named
STP - {experimentName} - {variantName}and target theexp_variant_stringparameter. - The audience IDs are stored back on the variant in Split Test Pro so future activations re-use them rather than creating duplicates.
You can then build GA4 explorations or audience-targeted comparisons, segmenting by the audience or filtering by the custom event.
Setting It Up
Open Settings → Integrations
In Split Test Pro, open Settings → Integrations (/settings#integrations) and click Connect next to Google Analytics 4.
Authorize via Google OAuth
You’ll be redirected to Google’s authorization screen. Sign in with the Google account that owns or has edit access to the GA4 property you want to connect. Grant the two requested scopes: analytics.edit and analytics.readonly.
analytics.editlets Split Test Pro list your GA4 properties in the picker and create audiences inside the property you select.analytics.readonlylets Split Test Pro read your GA4 traffic data for AI test ideas and Global Goals reporting.
Pick the GA4 property
After authorization, you’ll see a list of GA4 properties accessible to your Google account. Pick the one that corresponds to the site or store you’re running experiments on.
The measurement ID is auto-fetched from the property — you don’t need to look it up separately.
Confirm the integration is active
Back in Settings, pick the property and click Save. The status pill reads:
- Connected — Google is connected and a property is saved. From this point, every variant activation pushes data into GA4 automatically.
- Needs property — Google is connected but no property is saved yet. Pick one and save.
- Reconnect — the connection needs your consent again (see Reconnecting).
How the Custom Event Looks
When a visitor lands on a page running an experiment with GA4 enabled, the script fires a GA4 event:
event_name: experience_impression
parameters:
exp_variant_string: STP-{experimentId}-{variantId}
In GA4’s DebugView (or your real-time stream if your debug session is enabled), you’ll see this event landing for each visitor exposed to a variant.
The STP- prefix makes it easy to filter for Split Test Pro events specifically when you have other custom events in your property.
Audience Sync
The first time a variant activates after GA4 is connected, Split Test Pro calls the GA4 Admin API to create an audience for it:
- Name:
STP - {experimentName} - {variantName} - Filter: members are users whose
exp_variant_stringparameter matches this variant’s specific value - Scope: across all sessions (cross-session audience)
The audience ID is saved back on the variant record. Subsequent activations don’t re-create — they reference the existing audience. The audience starts populating immediately and stays available for the lifetime of your GA4 property.
Why audience sync matters
A GA4 audience is a first-class object in your GA4 property. You can:
- Compare the audience’s behavior to your overall site population in any GA4 report.
- Use the audience as the basis of a GA4 exploration with custom dimensions (geo, traffic source, device).
- Connect the audience to Google Ads as a remarketing or exclusion list.
The Split Test Pro Results dashboard tells you whether a variant won. The GA4 audience tells you why — what kind of visitor reacted differently, what their broader behavior looked like, and whether the win generalizes to your remarketing audience.
Server-side tests and GA4
Audiences are created for server-side tests too, but the experience_impression event is sent by the pixel, which never runs a server-side test — so those audiences stay empty until you send the event yourself. The experiment’s Results note says so: “GA4 audiences for server-side tests fill only when your site sends the impression event”. Send experience_impression with exp_variant_string set to STP-<experimentId>-<variantId> from the page (gtag) or from your server (Measurement Protocol); the ids come from the evaluation response. See GA4 for server-side tests.
Verifying the Integration
After connecting, run a quick smoke test:
Trigger a variant activation
Visit a page with an active experiment in a fresh browser (incognito). The variant CSS or JS should apply.
Check GA4 DebugView
In your GA4 property, open Configure → DebugView (you may need to enable debug mode in your browser via the Google Analytics Debugger extension or ?debug_mode=true). Within ~30 seconds, you should see an experience_impression event with an exp_variant_string parameter.
Check the Audiences list
Open Admin → Audiences in GA4. You should see one or more STP - {experimentName} - {variantName} audiences. They start with 0 members and populate as visitors activate the experiment.
If any of these steps fail, see Troubleshooting below.
Reconnecting
Connections made before Split Test Pro asked for the analytics.readonly scope show a Reconnect pill and a note: “Reconnect Google Analytics so Split Test Pro can read your traffic data for AI test ideas and Global Goals reporting.”
Exposure events and audiences keep working in the meantime — only the read features need the new consent. Click Reconnect, approve both scopes on Google’s screen, and the pill returns to Connected.
Disconnecting
To revoke the integration:
- Open Settings → Integrations (
/settings#integrations). - Click Disconnect next to Google Analytics 4 and confirm: “Disconnect Google Analytics? Existing audience IDs remain in GA4 but won’t be updated.”
- The OAuth tokens are deleted from Split Test Pro. Experiment exposures stop going to GA4.
The GA4 audiences already created remain in your GA4 property — they’re not auto-deleted. Clean them up manually in GA4 Admin → Audiences if you don’t want them anymore.
Troubleshooting
- OAuth fails with “insufficient permissions.” The Google account you authorized with doesn’t have edit access to the GA4 property. Either grant edit access or use a different Google account.
- Events aren’t appearing in DebugView. The
experience_impressionevent is sent through your page’s own GA4 tag (gtag), so GA4 must already be installed on the page. Confirm the script is loading on the page (Network tab → look forexperiment.js). Confirm the variant is actually activating (the variant’s CSS/JS should appear). Confirm GA4’s measurement ID matches the property you’re checking DebugView in. - Audiences aren’t being created. Audience creation happens on first activation per variant. If no visitor has been bucketed into the variant yet, the audience doesn’t exist yet. Trigger a test visit and check again.
- Duplicate audiences. Each variant should have exactly one audience. If you see duplicates (different IDs for the same variant), there may have been a race condition — contact support.
Privacy Considerations
The integration sends only:
- Anonymous visitor identifiers (the GA4 client ID)
- The experiment ID, variant ID, and timestamp
No PII is sent — Split Test Pro doesn’t have access to PII in the first place. Whatever consent flow you have for GA4 already (cookie banners, regional opt-outs) governs the GA4 client ID; the Split Test Pro integration inherits that consent automatically.
Next Steps
- Use GA4 audiences for richer segmentation than the in-app device filter: Segmenting Results.
- Confirm the broader privacy story for both platforms: Privacy and Consent.
- See where GA4 fits in your account configuration: Workspaces.