A/B testing with GA4
GA4 doesn't run A/B tests by itself. AB Splits runs the test and sends each visitor's variant to GA4, so you can compare variants in any GA4 report, audience or exploration.
Free plan · 1,000 visitors / month · no card
Set up in 4 steps
- 01Keep your existing GA4 tag (gtag.js or Google Tag Manager).
- 02Add the AB Splits snippet. It finds gtag or the dataLayer automatically.
- 03In GA4, register absplits_variant as a custom dimension so you can use it in reports.
- 04Break down conversions, revenue or engagement by variant in Explorations.
Event sent to GA4 for each tested visitor
gtag("event", "absplits_exposure", {
absplits_experiment: "…",
absplits_variant: "Variant B",
});Your real site key is shown in the dashboard after you add your site.
What to test on GA4
All 56 examples →Lead with the outcome, not the product category
Say what happens next on the button
Default the pricing toggle to annual
Cut the form to the fields you actually use
Show star rating and review count by the buy button
Move customer logos above the fold
AI writes variants
Choose a headline or button and AI reads your real page to write 3–5 alternatives, each with its reasoning.
Honest stats
Chance to beat the original, 95% intervals, and a plain keep-running or stop verdict. No p-value guesswork.
Results in GA4
Every tested visitor is tagged in GA4, so any report can be split by variant.
Questions
Does it work with Google Tag Manager?+
Yes. If there's a dataLayer, the snippet pushes an absplits_exposure event to it, which you can use as a GTM trigger.
Why do my GA4 numbers differ from AB Splits?+
GA4 applies its own sampling, consent modelling and session rules. AB Splits counts every exposure and conversion directly. Use AB Splits for the test verdict and GA4 for deeper slicing.
A/B testing on other platforms