Skip to content
Docs
Integrations

Google Analytics 4

Send each test's exposures to GA4, so you can split any GA4 report by variation using the numbers you already collect.

On this page 7

Connect GA4 and every test sends one event when a visitor enters it. You can then split any GA4 report by variation, using the numbers you already collect.

It is a switch, not a form. There is nothing to paste and nothing to add to your site. Your Google tag is already on the page and already knows your measurement ID, so there is nothing for us to hold.

This does not replace your result screen. It lets you ask GA4 questions about a test that we do not answer, such as how each variation behaved in a report you built yourself.

Before you start

Two things have to be true already:

  • The Google tag is on your site. You added it yourself, or Tag Manager loads it for you. Either works.
  • You can edit your GA4 property. Two of the three steps happen in GA4 Admin.

How to set it up

  1. Open project settings, find Google Analytics 4 and press Connect. Nothing is added to your site and there is nothing to build in Tag Manager. From the next page view, a visitor entering a test sends one event to GA4.
  2. Tell GA4 to keep the parameter. In GA4, go to Admin, then Custom definitions, then Create custom dimension. Set the scope to Event and the event parameter to exp_variant_string. Name it whatever you want to read in your reports.
  3. Make one audience per variation. In GA4, go to Admin, then Audiences, then New audience. Add one condition: exp_variant_string exactly matches the value for that variation. Repeat for each variation. Those audiences then work as comparisons in any GA4 report.
Warning

Do step two on the day you connect. GA4 throws away a parameter it was not told to keep, and it never goes back for the ones it threw away. Connect on Monday and add the custom dimension on Friday, and that week is gone.

What we send

One event per test the visitor enters:

js
gtag('event', 'experience_impression', { exp_variant_string: '...' });

The value is three names joined by hyphens: the tool, the test, then the variation. Each part is cut to 20 characters, and a hyphen inside a name becomes a space so the three parts stay readable.

The tool part is SplitStat. So a test called "Checkout: itemised vs plain" with a variation called "Itemised" sends a value reading SplitStat-Checkout: itemised…-Itemised.

That is Google's own format for a third-party testing tool. We send names rather than IDs, because a value reading SplitStat-472-3 is a number you have to look up in another tab.

What each label means

Where Label What it means
Project settings Connect Turns it on for the whole project. No ID to paste.
Project settings Disconnect Stops all sending. What GA4 already has, it keeps.
A test, step five Google Analytics 4 Whether this one test sends. On unless you turn it off.
In GA4 exp_variant_string The event parameter carrying the test and variation.
In GA4 experience_impression The event name to look for.

There is no link to your GA4 property from here. You may have several, and we are never told which one your Google tag points at.

Good to know

  • Connecting is a statement about the whole project. Every test sends from then on. Turn it off for one test at step five of that test, under Configuration.
  • The event fires when a visitor enters a test, not on every page view. One visitor in one test is one event.
  • A visitor in two tests at once sends one event per test.
  • GA4 is not the judge. Numbers in GA4 are counted GA4's way, over GA4's own windows, so they will not match your result screen exactly. Read the result screen for the verdict and GA4 for the wider picture.
  • Nothing you do in GA4 can change a running test. The sending is one way.
  • If your test names are long, the 20 character cut is what you will see in GA4. Short test names read better in a report column.

Using Tag Manager without a Google tag

Almost nobody needs this. If Tag Manager is on your page but no Google tag is, there is nothing for us to send through, so we push the event into your data layer and you catch it.

In Tag Manager, build three things:

  1. A Data Layer Variable named exp_variant_string.
  2. A Custom Event trigger on experience_impression.
  3. A GA4 Event tag with that event name and one parameter, exp_variant_string, set to the variable.

Fire the tag on the trigger, then Submit and Publish.