Crazy Egg

Google Analytics 4 (GA4) Integration for Analyzing A/B Tests

Disclosure: Our content is reader-supported, which means we earn commissions from links on Crazy Egg. Commissions do not affect our editorial evaluations or opinions.

You can now use Google Analytics 4 (GA4) to analyze and segment engagement metrics, for each of your A/B Testing page variants on Crazy Egg.

By combining GA4’s quantitative analytics with Crazy Egg’s own Heatmaps and Session Recording capabilities for each page variant, you get powerful insights into how your A/B Tests impact user behavior and conversion rates on each page — all with just a single paid plan.

How does the Google Analytics integration work?

The integration works by sending a custom event to GA4 when an A/B Test variant is viewed by a site visitor.

You will be able to see the total count of pageviews on A/B Test variants, along with the unique visitor count and related conversions.

These custom events are sent with all the parameters that GA typically provides. This means that for each A/B Test in Crazy Egg, you can now:

  • Compare engagement metrics like: New vs. Returning Users, Average Session Duration, Exit Rate, Bounce Rate, Pages per Session, and more.
  • Segment by dimensions like: URL, Device, Browser, Screen Resolution, Country, Source/Medium, Campaign, and more.

In addition, these events come with custom properties for:

  • ID of the associated A/B Test
  • Name of the associated A/B Test
  • ID of the page variant viewed 
  • Name of the page variant viewed

So you will not only be able to compare the results of page variants within the same A/B Test, but also to compare variants belonging to different A/B tests altogether.

How do I set up the Google Analytics integration for Crazy Egg?

Depending on how you’ve already installed GA on your site, you can either:

  • Configure your GA settings to report on the custom event properties that Crazy Egg sends when an A/B Test variant is viewed.
  • Create a new tag in Google Tag Manager (GTM).

These steps only have to be performed once to integrate Crazy Egg fully with Google Analytics.

Follow our integration guide to connect your Crazy Egg and GA4 accounts, and get deeper metrics on how your A/B Tests are performing today.


Ready to get started, driving more value from your website performance?

Get started generating your first Heatmaps and A/B Tests on Crazy Egg — free with a 30-day trial.


Stephen is Director of Growth Marketing at Crazy Egg. An experienced go-to-market leader for B2B startups, he previously led teams at Nira, Paddle, and ProfitWell.

Make your website better. Instantly.

Over 300,000 websites use Crazy Egg to improve what's working, fix what isn't and test new ideas.

Free 30-day Trial