Crazy Egg can optionally send a custom event to Google Analytics whenever an A/B Test variant is viewed by one of your site visitors. This event will include custom properties specifying the name and ID of the variant that was viewed and the name and ID of the associated A/B Test for use in your Google Analytics reports.
Integration method
Crazy Egg sends its custom events to Google Analytics in one of two ways, depending on how you installed GA4 on your site. This article is for those who installed GA4 using Google Tag Manager.
Google Tag: If you installed GA4 via the Google tag (gtag), see A/B Test and Google Analytics Integration.
Configure Google Tag Manager (GTM)
Crazy Egg GA4 GTM integration.json.Crazy Egg workspace.

Configuring Custom Definitions in Google Analytics
You will need to configure Google Analytics to report on the custom event properties that Crazy Egg sends. Otherwise, they will not consistently appear in your GA reports. These steps are repetitive, but they only have to be performed once to integrate Crazy Egg fully with Google Analytics.
- Enter
Crazy Egg AB Test IDinto the Dimension name field - Enter
crazyegg_ab_test_idinto the Event parameter field - Click Save
- Enter
Crazy Egg AB Test Nameinto the Dimension name field - Enter
crazyegg_ab_test_nameinto the Event parameter field - Click Save
- Enter
Crazy Egg Variant IDinto the Dimension name field - Enter
crazyegg_variant_idinto the Event parameter field - Click Save
- Enter
Crazy Egg Variant Nameinto the Dimension name field - Enter
crazyegg_variant_nameinto the Event parameter field - Click Save
- Enter
Crazy Egg AB Test and Variantinto the Dimension name field - Enter
crazyegg_ab_test_and_variantinto the Event parameter field - Click Save
Afterward, the Custom dimensions table should have four new custom dimensions:
| Dimension name | Description | Event |
|---|---|---|
| Crazy Egg AB Test ID | Crazy Egg A/B Test ID | crazyegg_ab_test_id |
| Crazy Egg AB Test Name | Crazy Egg A/B Test Name | crazyegg_ab_test_name |
| Crazy Egg Variant ID | Crazy Egg Variant ID | crazyegg_variant_id |
| Crazy Egg AB Test and Variant | Crazy Egg A/B Test and Variant | crazyegg_ab_test_and_variant |
| Crazy Egg Variant Name | Crazy Egg Variant Name | crazyegg_variant_name |
Confirming your integration
crazyegg_variant_view event should appear in this section.crazyegg_variant_view event name will show the event counts for the event properties defined earlier: crazyegg_ab_test_id, crazyegg_variant_id , etc.