# How to enable EmotionsAI audience for GA4

AB Tasty can export a visitor’s **EmotionsAI audience** alongside the campaign hit. This allows segmentation of exposed visitors.

{% hint style="warning" %}
This feature is part of our *Early Adopters program*. Contact your CSM to join.
{% endhint %}

{% stepper %}
{% step %}

### Create **user-scoped custom dimension in** GA4

Since EmotionsAI audiences are linked to a user, you must create a **user-scoped custom dimension**:

1. Go to **Admin > Property > Custom definitions**.
2. Create a custom dimension:
   * **Dimension name**: e.g., `Audience Emotion AI`
   * **Scope**: `User`
   * **Description**: any meaningful description
   * **Event parameter/User property**: `audience_emotion_ai`
3. Click **Save**.

{% hint style="warning" %}
If the dimension is not configured correctly, GA4 will not display the EmotionsAI audience, even though AB Tasty is sending it as a user property (`up.audience_emotion_ai`).
{% endhint %}
{% endstep %}

{% step %}

### Check Data availability

Sometimes, an EmotionsAI audience is not yet defined when the campaign hit is sent. In such cases, the field may remain empty. This occurs because the campaign hit is triggered immediately when AB Tasty loads, while audience detection takes about 30 seconds for a new visitor.

<img src="/files/98zSFCsKuYjAuSNrOney" alt="" width="375">

If your custom dimension **is not set correctly,** even if we’re sending the EmotionsAI audience, you won’t be able to retrieve it. **We’re sending this information as a user property.**
{% endstep %}

{% step %}

### Check integration <a href="#h_01jcr20nc856jx3exm90gkb4vz" id="h_01jcr20nc856jx3exm90gkb4vz"></a>

[Verify](/integrations/push-integrations/setting-up-google-analytics-4-integration-with-ab-tasty.md#h_01gnf071qndevpfdnwpsmxebvs) if data has been sent correctly. For EmotionsAI audience specifically, information is available inside ***`up.audience_emotion_ai`***

<img src="/files/MVGDHb5rClfzQUdzWqsE" alt="" width="383">

Sometimes, an EmotionsAI audience is not yet defined when the AB Tasty campaign hit is sent. As a result, even if an EmotionsAI audience is activated, the value may remain empty. This happens because, when a new visitor arrives on your website, the campaign hit is triggered as soon as AB Tasty loads, whereas it takes about 30 seconds to determine which EmotionsAI audience the visitor belongs to.
{% endstep %}
{% endstepper %}


---

# 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.abtasty.com/integrations/push-integrations/setting-up-google-analytics-4-integration-with-ab-tasty/how-to-enable-emotionsai-audience-for-ga4.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.
