Skip to content
Peekbird

Google Analytics 4

Peekbird can tell Google Analytics 4 which variation each visitor saw, so you can look at your tests in GA4 too: split any GA4 report by variation, or build an audience of the visitors who saw one.

Turn it on

  1. In your site's Testing settings (under A/B testing), under Google Analytics 4, switch on Send test variations to Google Analytics 4.
  2. GA4 must be on the same pages, installed with gtag.js or with Google Tag Manager's Google tag.

Your pages pick it up within about a minute. It adds a few hundred bytes to the snippet, for sites that turn it on.

What GA4 gets

When a visitor is counted in a variation, once a visit, Peekbird sends GA4 the event it takes from A/B testing tools:

gtag('event', 'experience_impression', {
  exp_variant_string: 'PEEKBIRD-exp_8k2m1q9x4c7a-var_3n8p5r2t6w1z'
});
  • exp_variant_string is PEEKBIRD-, the test's ID and the variation's ID. Testing settings lists each running test's variations with theirs.
  • It's sent once the page has loaded, after your GA4 setup has run, so GA4 knows where to send it. A visitor who leaves before that isn't sent.
  • QA and preview visits aren't sent, as they never count in Peekbird either.
  • Variations your server decides (the server SDKs) aren't sent to GA4; those in the page are, including "In your code" experiments decided there.

See it in GA4

  1. In GA4, go to Admin → Custom definitions and create a custom dimension: scope Event, event parameter exp_variant_string.
  2. In Explore, add that dimension to a free-form exploration, with the event name experience_impression, to count visitors per variation.
  3. For conversions per variation, build a segment or an audience of users with that event and variant string, and compare them in any report.

Custom dimensions count from the day they're created, so create it before you need the numbers.

Peekbird's results and GA4's

GA4 counts its own way: its consent mode, ad blockers, sampling and its own idea of a user all play a part, so its numbers won't match Peekbird's exactly. Decide with Peekbird's results, which say how sure a difference is (see How results are calculated), and use GA4 to look at a test from its side: other events, other reports, your audiences.

Peekbird sends GA4 nothing for visitors it doesn't count, where your site waits for consent (see Consent). What GA4 does with what it gets follows GA4's own consent settings.

See what your visitors see.

Start free in a few minutes: one snippet, every feature. Move to a bigger plan when you need more tracked visits.