# How to configure GA4 Measurement Protocol

{% hint style="warning" %}
This Feature is still in EA - if you want to enable it, contact your CSM
{% endhint %}

Google Analytics 4 Measurement Protocol allows you to send event data to GA4 directly from the server, instead of relying only on the client-side tag. This ensures more reliable tracking, even when ad blockers or network restrictions prevent client-side events from firing.

By adding your API secret in the AB Tasty GA4 connector, you can activate server-to-server data push.

Learn more about [Measurement Protocol in GA4.](https://developers.google.com/analytics/devguides/collection/protocol/ga4)

### Configuration steps

{% stepper %}
{% step %}

### Find your API Secret

To retrieve your GA4 API secret:

1. In Google Analytics, go to **Admin > Property > Data Streams**.
2. Select your data stream.
3. Under [Measurement Protocol API secrets,](#user-content-fn-1)[^1] click **Create**.
4. Name your secret, then copy the generated API secret.
   {% endstep %}

{% step %}

### Add the API Secret in AB Tasty

To create or edit a connector, look at [the general article for GA4 ](https://docs.abtasty.com/integrations/push-integrations/setting-up-google-analytics-4-integration-with-ab-tasty)

* Go to **Integrations > Integration Hub**.
* Create or edit your **Google Analytics 4 Push connector**.
* Paste your API secret into the [Measurement Protocol](#user-content-fn-2)[^2] field.
* Save your configuration.
  {% endstep %}
  {% endstepper %}

Once enabled, AB Tasty sends campaign events to GA4 from the client-side session to the server, ensuring better reliability.

## Benefits of Using Measurement Protocol

* **Data resilience**: The same event is used for our tag & the data collected for Google
* **Improved accuracy**: Reduces discrepancies caused by ad blockers or script errors.
* **Full coverage**: Complements client-side event tracking with robust server-side data.

## Troubleshooting

If data doesn’t appear in GA4:

* Double-check that your API secret is valid and active.
* Make sure the campaign was launched (events only send when a campaign is live).

[^1]: ![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2F7g9cFeyc7dDNR3FPboH1%2FCapture%20d%E2%80%99e%CC%81cran%202025-09-22%20a%CC%80%2017.17.21.png?alt=media\&token=9f69c9f3-c639-42de-baea-6773775be706)

[^2]: ![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FWjmO2ftu7FVJ2rJAHHsU%2FCapture%20d%E2%80%99e%CC%81cran%202025-09-22%20a%CC%80%2017.18.45.png?alt=media\&token=9f8a5b3a-da57-4810-8086-0b04f8efeab5)


---

# 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-configure-ga4-measurement-protocol.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.
