# GA4 Integration

Google Analytics 4 (GA4) lets you collect visitor data on your websites and apps for analytical purposes. You can import audiences from GA4 into your CustomFit account and create GA4 audiences directly from your CustomFit dashboard by linking your CustomFit account with GA4.

Integrating CustomFit with GA4 is a one-time process. You don't need to repeat this procedure every time you create a new experience.

{% hint style="warning" %}
You must first verify that the GA4 code is installed on your website before continuing. If Google Tag Manager (GTM) was used for installation, please follow the instructions present in this [document](https://doc.customfit.ai/integrations/ga4-integration-via-gtm).
{% endhint %}

### Enabling GA4 Integration

Perform the following steps to integrate GA4 with your CustomFit account:

* Log in to your CustomFit dashboard.
* From the dashboard sidebar, click on **Settings > 3rd Party Integrations.**
* On the integrations page, you can see the **Google Analytics 4** section.

<figure><img src="/files/enN7VCuj0mAAi07ijUII" alt=""><figcaption></figcaption></figure>

* Click on the status field to enable Google Analytics 4 integration.

### Configuring GA4

* Once GA4 has been enabled, you will be redirected to the settings page. Or you can access the GA4 settings page by clicking on the Settings button present in the **Google Analytics 4** section.
* Connect your GA4 account with CustomFit.ai by clicking on **Sign in with Google.**

<figure><img src="/files/evdjAudBoLnNz7h9irYg" alt=""><figcaption></figcaption></figure>

* Confirm the Google account you wish to use with CustomFit. Then, click Allow to provide permissions.

<figure><img src="/files/pANtLN71TL2rbDzJN3Ci" alt=""><figcaption></figcaption></figure>

* If the integration is successful then you can see your GA4 connected email successful,.

<figure><img src="/files/O2TO6ZMnZir6An5pcGp8" alt=""><figcaption></figcaption></figure>

* If you have installed GA4 through GTM then select the Tag installation mode as Google Tag Manager and Click on **Save** button. Follow the instructions listed in this [document](https://doc.customfit.ai/integrations/ga4-integration-via-gtm) to integrate GA4 through GTM.

<figure><img src="/files/VNzL7PwpMTCpfqWDnIg8" alt=""><figcaption></figcaption></figure>

### Setting up Experience Behavior as Audience in GA4

You can create audiences for your experience in your GA4 account directly from your CustomFit dashboard. It spares you from repeatedly setting up your GA4 filters in order to create audiences. Perform the following steps to accomplish it:

* Select **Allow CustomFit.ai to create GA4 audiences,** and click on the **Save** butto&#x6E;**.**

<figure><img src="/files/8a7nIlTXQlLQv61YQDa9" alt=""><figcaption></figcaption></figure>

* Now you will be able to set up your experience behavior as an audience in GA4. You can setup the audience while creating an experience or even after the experience has been created. To set up an audience in an experience, go to the integrations tab under an experience and click on **Set up Behaviors as Audiences in GA4**.

<figure><img src="/files/9ttxrSULe6ZDzJjldoL1" alt=""><figcaption></figcaption></figure>

* Choose the GA account and property from the Set up Audiences pop-up. By doing this, the Audiences section will be enabled and it will populate all the versions of experience behaviors to be setup as Audiences in GA4.

<figure><img src="/files/oWgohCrstqKTRAjoF2Gj" alt=""><figcaption></figcaption></figure>

* Type the versions' names into the corresponding text areas. This name will be used to identify the audiences in the GA4 account. Once done, click on the **Save** button. The audience will be created only when you **power on** the experience.
* You can only remove audiences once they have been set up; you cannot change any already-existing audiences. To do so, click on **Manage Audiences**.

<figure><img src="/files/B8iNwR7IDRfmD46CbOtQ" alt=""><figcaption></figcaption></figure>

* To remove an audience, click on the Delete icon for that audience. Click on Delete all to remove all the audiences. Once done, click **Save** button to confirm the changes.

<figure><img src="/files/GE3nS4j9irptOHX8xjFT" alt=""><figcaption></figcaption></figure>

### Reports in GA4

Once your audiences are created, you can compare them in your GA4 account for various parameters such as average Session Duration, Revenue, Bounce rate, etc. To view the reports, perform the below steps:

* On your GA4 dashboard, go to User Acquisition. This is the report for all the users.

<figure><img src="/files/mC2EZLHvCIRa2b7qlEFr" alt=""><figcaption></figcaption></figure>

* If you want to compare the user acquisition report with one of the audiences created by CustomFit, then click on **Add Comparison**. Enter the **dimension** as the audience name, then under **Match Type,** select **exactly matches,** and under the value, select the experience behavior of the audience that you want to compare. Next, click on the **Apply** button.

<figure><img src="/files/5histvpvMBMHysiqdj8o" alt=""><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/8lkykgOFEQk>" %}

### Using GA4 audience to target visitors

To target website visitors for your experience, you may also import the audiences from GA4 into your CustomFit account. For example, you can use the audience that has added items to a wishlist and provide them with a special discount when they land on the website. To import GA4 audiences, perform the below steps:

* In the GA4 settings page, select **For CustomFit.ai experiences, use the GA4 audience to target visitors** option, and click on the **Save** button.

<figure><img src="/files/GhTWF7TPhiWbbPutpIVr" alt=""><figcaption></figcaption></figure>

* Navigate to the experience where you wish to set up the GA4 audience as a rule.
* Click on **Add Rules**.

<figure><img src="/files/oSLkEIoYE2T4TxXuiCHs" alt=""><figcaption></figcaption></figure>

* From the list of options available, select **GA4 Audience.**

<figure><img src="/files/v2KhCKUnQOiuvr7r52U8" alt=""><figcaption></figcaption></figure>

* To view the Audience list for a particular GA4 account and property, pick it from the popup.

<figure><img src="/files/mZ20l63tKkdUAJyWvE6M" alt=""><figcaption></figcaption></figure>

* The **Audience match** and **Audience not match** options let you decide whether to include or exclude the user from the audience list.

<figure><img src="/files/X4vbHXSOVMvua1LiaZLD" alt=""><figcaption></figcaption></figure>

* Next, choose the necessary GA4 audience from the final dropdown menu.

<figure><img src="/files/s6sHGcomT3XEnEp4CF4e" alt=""><figcaption></figcaption></figure>

* Lastly, to save the configuration, click the **Save** button.

<figure><img src="/files/YKQuQBNSxegHKOmvzEYC" alt=""><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/oQrqM4P0EO0>" %}


---

# 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://doc.customfit.ai/integrations/ga4-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.
