> For the complete documentation index, see [llms.txt](https://server-side.docs.sirdata.net/sirdata-server-side/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://server-side.docs.sirdata.net/sirdata-server-side/english-1/installation/configuration-ga4.md).

# Configuration GA4

{% hint style="danger" %}
Attention! Sirdata offers a comprehensive service for setting up and configuring your Google Analytics 4 (GA4) and Google Tag Manager (GTM) clients, as well as your GA4 and Facebook Conversions API (CAPI) tags.\
\
If you are not fully confident with server-side tracking and its configuration, do not hesitate to [contact us](https://www.sirdata.com/en/Contact).
{% endhint %}

## 1) Creating and configuring the "Clients" in your server container

### a) Client "GA4"

When your server container is created, a GA4 client is already created by default:

<figure><img src="/files/hEGVee2cgvjkKpcF8JR8" alt=""><figcaption><p>Client "GA4"</p></figcaption></figure>

You must first configure this **GA4 client**.

* Add a high priority, for example: 100
* Check the box: "Default gtag.js paths for specific IDs"
* Add your Measurement ID
* In "Enable region-specific settings", "Choose a built-in variable", select "Visitor Region"
* In "More settings", check the box "Migrate from JavaScript Managed Client ID"
* Save

<figure><img src="/files/4q9VoycZ5LqMEvpHEX2g" alt=""><figcaption><p>GA4 client configuration</p></figcaption></figure>

### b) Client "GTM"

Add and configure the "GTM" client. You also need to add your web container ID:

<figure><img src="/files/Qw6vQHwYgoY3R2ekhpkf" alt=""><figcaption><p>Client "GTM"</p></figcaption></figure>

Configuration of the **GTM client**:

* Add the "Google Tag Manager: Web Container" tag
* Leave the Priority at 0
* Add the ID of your GTM Web container
* Leave the 3 boxes checked and add "Visitor Region" as a "built-in variable"

<figure><img src="/files/dJcgjOX0xLHxh5XBo2kQ" alt=""><figcaption><p>GTM client configuration</p></figcaption></figure>

## 2) Creating the GA4 tag in your server container

### a) GA4 Tag

Add the "Google Analytics: GA4" tag in the "Tags" section of your server container:

<figure><img src="/files/73TyJs6F4EwB3gTxnBVd" alt=""><figcaption><p>"Tags" section</p></figcaption></figure>

<figure><img src="/files/hkK7gd0QFRYUaaRSRHbN" alt=""><figcaption><p>Tag "Google Analytics: GA4"</p></figcaption></figure>

Do not touch the tag configuration:

<figure><img src="/files/P9FnyWd8SWiklzFP8oOT" alt=""><figcaption><p>GA4 Tag</p></figcaption></figure>

You just need to add the "ClientNameGA4" trigger to this tag.

### b) Trigger "ClientNameGA4"

Add a trigger of type "Custom":

<figure><img src="/files/pPApJUkk8KOVfWYIitJG" alt=""><figcaption><p>Trigger "ClientNameGA4"</p></figcaption></figure>

In this trigger, add a new variable: "ClientName" of type "Client Name":

<figure><img src="/files/KvpVqSlCNrkgHSSkYndR" alt=""><figcaption><p>Variable "ClientName"</p></figcaption></figure>

Then, add the condition that the "ClientName" variable equals "GA4" in your "ClientNameGA4" trigger:

<figure><img src="/files/vwLYZ5TD7EX5XjDw57LD" alt=""><figcaption><p>Trigger "ClientNameGA4" with the variable "ClientName" equal to GA4</p></figcaption></figure>

## 3) Configuring the GA4 tag in your "client" container

Add the "server\_container\_url" configuration parameter to your Google GA4 tag, assigning it the URL of your subdomain (host) as its value. For example: <https://xyxxy.mywebsiteurl.com>

<figure><img src="/files/QH1JTHcaakxqzkfQMviQ" alt=""><figcaption><p>Configuration parameter "server_container_url"</p></figcaption></figure>
