> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abconvert.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GA4 Integration: Track Tests in Google Analytics

> Connect ABConvert to GA4 to receive test impression events and analyze test group performance alongside your other Google Analytics data.

Connect ABConvert to Google Analytics 4 (GA4) to analyze test groups alongside the behavioral data you already collect. After an eligible visitor enters a test, ABConvert sends a custom impression event through the GA4 tag on your storefront.

## What gets tracked

When the integration is active, ABConvert sends a `abconvert_experience_impression` event to your GA4 property each time a visitor enters a test. The event includes:

| Parameter | Description | Example |
| - | - | - |
| `abconvert_experiment_id` | The numeric test ID | `1001` |
| `abconvert_experiment_name` | The test name | `Homepage price test` |
| `abconvert_group_index` | The assigned test group index | `1` |
| `abconvert_variant_name` | The assigned test group name | `Variant B` |
| `abconvert_exp_variant_string` | Combined test + group key in the format `experimentId-groupIndex` | `1001-1` |
| `abconvert_assignment_reason` | Why this assignment happened | `random_split` |

These parameters are available as event parameters in GA4 and can be used to create custom dimensions, apply them to explorations, or build audience segments.

## Set up GA4

Your storefront must already load the GA4 web tag (`gtag`) for the web data stream you want to use. ABConvert does not install that tag. ABConvert sends the event when a visitor enters a test, so visitors who enter a test after you save the ID report to GA4. Visitors who entered before that do not.

**1. Find your GA4 Measurement ID**

In Google Analytics, go to **Admin** → **Data Streams** → select your web data stream. Your Measurement ID appears at the top right of the stream details panel. It follows the format `G-XXXXXXXXXX`.

**2. Copy the Measurement ID**

Click the copy icon next to the Measurement ID or select the full string (including the `G-` prefix).

**3. Save the ID in ABConvert**

Open **Integrations** → **Google Analytics 4**. Paste your Measurement ID and click **Save**.

**4. Verify the connection**

Visit an eligible page of a running test in a fresh browser session with analytics consent. Open **GA4 → Reports → Realtime** in the same property as the configured web data stream. Look for `abconvert_experience_impression` and inspect its test ID and test group. A saved ID alone does not confirm that GA4 received an event.

![GA4 Realtime overview showing event count by event name with abconvert\_experience\_impression listed in the event stream](https://mintcdn.com/abconvert/ZR9ptaJPTQV33cXt/images/configuration/ga4-realtime-streaming.png?fit=max\&auto=format\&n=ZR9ptaJPTQV33cXt\&q=85\&s=f544f064b1233c19936d6fb42d119a7e)

Verify impression events in GA4 Realtime

> [!NOTE]
>
> Your Measurement ID must follow the format `G-XXXXXXXXXX` (the letter G followed by a hyphen and alphanumeric characters). ABConvert validates the format when you save — if the field shows an error, double-check that you've copied the full ID from GA4.

## Building reports in GA4

Once the integration is running and impression events are flowing into GA4, you can analyze test data in several ways.

**Custom dimensions**

To use ABConvert event parameters in standard GA4 reports, register them as custom dimensions:

1. Go to **Admin** → **Custom definitions** → **Custom dimensions**
2. Click **Create custom dimension**
3. Set the scope to **Event**
4. Set **Event parameter** to one ABConvert parameter (for example `abconvert_experiment_name` or `abconvert_variant_name`)
5. Repeat for other parameters you want to report on

After registering, GA4 will start populating the dimension in reports going forward (historical data won't be backfilled).

![GA4 edit custom dimension dialog showing scope set to Event and event parameter field for an ABConvert parameter](https://mintcdn.com/abconvert/ZR9ptaJPTQV33cXt/images/configuration/ga4-custom-dimension.png?fit=max\&auto=format\&n=ZR9ptaJPTQV33cXt\&q=85\&s=b16da5e79cb269615653cbf4b6b5407c)

Set custom dimension scope to Event when registering ABConvert parameters

**Explorations**

GA4 Explorations give you the most flexibility for analyzing test results. To compare test groups, create one **user segment** per test group.

**1. Open Segment overlap in Explorations**

In GA4, go to **Explore** and choose **Segment overlap**.

**2. Create a user segment for Control**

Add a **User segment** with an event condition where event name equals `abconvert_experience_impression`, then filter the same event by:

`abconvert_experiment_id = <your experiment id>`

`abconvert_group_index = 0`

**3. Create a user segment for each other test group**

Duplicate the Control segment and change `abconvert_group_index` to `1`, `2`, or another index used in your test.

**4. Compare outcomes**

Add business metrics like purchases, revenue, or engagement and compare segments side by side.

![GA4 custom segment setup screen with User segment selected as the segment type](https://mintcdn.com/abconvert/ZR9ptaJPTQV33cXt/images/configuration/ga4-user-segment.png?fit=max\&auto=format\&n=ZR9ptaJPTQV33cXt\&q=85\&s=eeba97eb66e9a01c999c70a493cb6a9d)

Choose User segment in GA4 Explorations

![GA4 user segment condition builder filtering abconvert\_experience\_impression by ABConvert experiment and variant fields](https://mintcdn.com/abconvert/ZR9ptaJPTQV33cXt/images/configuration/ga4-user-segment-2.png?fit=max\&auto=format\&n=ZR9ptaJPTQV33cXt\&q=85\&s=40ade974db9408a4a51a150db4b9165c)

Build a user segment using ABConvert impression event parameters

> [!TIP]
>
> If you want a single filter field per segment, use `abconvert_exp_variant_string` (for example `1001-0` for Control and `1001-1` for Variant A).

**Funnel exploration**

Build a funnel exploration with steps for page view → add to cart → purchase, then apply test-group segments as breakdowns. This lets you see where visitors in each test group behave differently.

## Things to know

* GA4 impression events are sent from the visitor's browser. A missing storefront GA4 tag, declined analytics consent, or a content blocker can prevent delivery.
* Saving a Measurement ID does not add GA4 reporting to tests created before that save. Create a new test to verify the integration.
* The integration supplements ABConvert's own analytics — it does not replace them. Use ABConvert's dashboard for statistical significance calculations and conversion metrics; use GA4 for deeper behavioral and cross-channel analysis.
* There is no additional cost in ABConvert or GA4 for enabling this integration. GA4's standard event limits apply.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.