# Google Analytics Integration

{% hint style="info" %}
Please use javascript or React SDK version 11.20.0 or higher.
{% endhint %}

GA4 is the latest version of Google Analytics, a widely used web/app data analytics tool. By integrating Hackle with GA, you can view the results of experiments run in Hackle directly in GA data reports.

You can use the data already sent to GA as-is to review experiment results in the familiar GA reports. If you use BigQuery, even deeper analysis is also possible.

### **Policy**

Since GA data reports are used, GA's experiment-related limitations apply. For detailed GA limitations, refer to the [link](https://developers.google.com/analytics/devguides/collection/ga4/integration?hl=ko#limitations).

<table><thead><tr><th width="240.61328125">Item</th><th>Details</th></tr></thead><tbody><tr><td>GA Version</td><td>GA4 integration is supported (UA not supported)</td></tr><tr><td>Supported development environments</td><td>Web/WebApp environments are supported.</td></tr><tr><td>Number of connectable GA Property IDs</td><td>One GA Property ID can be connected per Hackle Workspace.<br>Development Environment is not supported.</td></tr><tr><td>Supported experiment types</td><td>A/B Test only (MAB Test not supported)</td></tr><tr><td>Number of A/B Test groups (Audiences)</td><td>Up to 4 test groups can be created per experiment. Audiences are created one per experiment number - experiment version - test group.</td></tr><tr><td>Audience retention period</td><td>365 days</td></tr></tbody></table>

### **Setting Up Integration**

1. Before integrating, both the Hackle SDK and GA SDK must be installed in your service.
2. Go to Workspace Settings > External Integration in the Hackle Dashboard. ([Link](https://dashboard.hackle.io/config/integrations))

![Workspace Settings - External Integration](/files/3PNZZD5fkDEgxqIYOHCV)

3. Select Google Analytics and start the configuration.
4. After logging in with your Google account, allow access to the Google account.

The Google account you log in with must be an editor (or higher) of the Google Analytics property.

![Google account access approval](/files/oEwc1hxxmOAQ45G17xhB)

5. In the popup that appears, enter the GA Property ID to connect with the Hackle Workspace. The GA Property ID can be found in the GA console under Admin > Property Settings > Property Details.

![GA Property](/files/cmP0uOmC7LI180yXrNpv)

6. Enter the Property ID and click the SAVE button to save the changes and complete the integration. Once the integration is complete, the integration status will display as "Integration Complete" and the connected Property ID value will be visible.

![GA Integration Complete](/files/jdi1EzwCwSQMdH52RhZB)

### **Starting an Experiment**

1. When you create an A/B Test in Hackle and start the experiment, audiences are automatically created in GA. Audiences are created per experiment version and per test group.

![Experiment start and Traffic Allocation](/files/EJiJSXB63wrcy39tDHFU)

2. In the GA console, you can verify this under Configuration > Audiences as shown below. Audience names follow the format: HACKLE-EXPERIMENT-{experiment number}-{experiment version}-{test group}.

![GA Audience verification](/files/MfeezjMiLFkJWJsRw51X)

3. When actual user traffic enters the experiment, the user count in the GA audience will also increase. Click "Add new comparison" in the desired GA report and select the audience you want to filter, allowing you to view data filtered to that audience only. Add comparisons per experiment group to compare performance across groups.

![GA Report > Add new comparison](/files/u46xPqIUCYWuoeLNg4wa)

4. After the experiment ends, if you no longer need data analysis for that audience, it is recommended to delete the audience.

#### FAQ

**Q. The audience appears correctly in GA4, but data is not accumulating for that audience.**

A. To view user information in GA4, you need **gtag function insertion** and **domain allowlisting**.

* For the gtag function, refer to the [gtag installation guide](https://developers.google.com/tag-platform/gtagjs/install?hl=ko) below.
* For the tag to work, the domain also needs to be allowed. To allowlist your domain, check whether the domain has been added under Settings - Data Streams.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/external-link/google-analytics-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
