Google Analytics 4 Integration
Connect Split Test Pro to GA4 via OAuth. Variant data flows into your GA4 property as custom events, and each variant gets its own GA4 audience for cross-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, navigate to Settings. Find the Integrations section 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 requested scope: analytics.edit.
This scope lets Split Test Pro:
- Read your GA4 properties (so we can list them in the picker).
- Create and update audiences inside the property you select.
- Send events to the property’s measurement endpoint.
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, the GA4 row should show Connected with the property name. From this point, every variant activation pushes data into GA4 automatically.
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.
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.
Disconnecting
To revoke the integration:
- Open Settings → Integrations.
- Click Disconnect next to Google Analytics 4.
- The OAuth tokens are deleted from Split Test Pro’s database. New variant activations stop sending events 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. Confirm the script is loading on the page (Network tab → look for
experiment.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.
Ready to start testing?
Install Split Test Pro and run your first experiment today.