# Analyze experiments in GA4

URL: https://docs.ablyft.com/developers/integrations/google-analytics-4-data/

> Create custom dimensions and a free-form exploration to compare ABlyft variations in Google Analytics 4.



This guide assumes that the [Google Tag Manager + GA4 connection](https://docs.ablyft.com/developers/integrations/google-tag-manager-ga4/) is
set up and sends data.

## Create custom dimensions

1. In GA4, select the property and open **Admin → Custom definitions**.
2. Create custom dimensions with the scope **Event**. If you also track on user level, create the same dimensions with
   the scope **User**. The scope must match your GTM setup.

| Dimension name         | Event parameter   |
| ---------------------- | ----------------- |
| ABlyft project ID      | `project_id`      |
| ABlyft project name    | `project_name`    |
| ABlyft experiment ID   | `experiment_id`   |
| ABlyft experiment name | `experiment_name` |
| ABlyft variation ID    | `variation_id`    |
| ABlyft variation name  | `variation_name`  |

Use the description "Used to analyse ABlyft experiments." Data can take up to 48 hours to appear.

## Find the IDs in ABlyft

Open **Experiments** and click the information icon next to the **Results** button of the experiment. You find the
project, experiment and variation IDs and names there.

## Build the exploration

1. In GA4, choose **Explore** and start a **Blank** exploration. Name it like the experiment.
2. Create a **user segment** `Control` with the condition **ABlyft variation ID** exactly matches the ID of the original.
3. Create a second user segment, for example `Variant 1`, with the ID of the variation.
4. Apply both segments to the exploration.
5. Add the dimension **Device category** and the metrics **Total users** and **Purchases** (or another conversion metric).
6. Set the date range to the period in which the experiment was running.

