# Create a Measurement Protocol API secret in GA4

To enable Littledata to add server-side events to your Data Stream via the Measurement Protocol API, you need to create a new **Measurement Protocol API secret** for your Data Stream:

{% stepper %}
{% step %}

#### Open your Data Stream

Go to your Google Analytics Admin > Data collection and modification > Data Streams, and **open your chosen stream**:

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-f41937031b44d8b07f85327e0910911a6d1d63ed%2Fmeasurement-protocol-api-data-stream-location.png?alt=media)
{% endstep %}

{% step %}

#### Create a new API secret

Scroll down to the **Events** tab and click **Measurement Protocol API secrets**. Then click **Create**:

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-82f56637300cc8c77605a2546db709a8911ae363%2Fscreenshot-2023-07-24-at-11.09.40.png?alt=media)

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-d5dc8ab0f88af4a896b4e6dd22a21c6dfaba2c1b%2Fscreenshot-2023-07-24-at-11.10.54.png?alt=media)
{% endstep %}

{% step %}

#### Name the secret

Create a nickname for your new API secret. We recommend naming it **Littledata**. Then click **Create**:

![](https://res.cloudinary.com/littledata/w_760,h_380,c_fit/littledata-blog-images/2020/11/Screenshot-2020-11-18-at-13.12.48.png)
{% endstep %}

{% step %}

#### Copy the secret value

Copy the **Secret value** provided.

*This value is confidential and should only be shared with Littledata.*

![](https://res.cloudinary.com/littledata/w_834,h_164,c_fit/littledata-blog-images/2020/11/Screenshot-2020-11-18-at-13.16.55.png)
{% endstep %}

{% step %}

#### Done

All done!
{% 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://help.littledata.io/integrations/shopify-to-google-analytics/create-a-measurement-protocol-api-secret-in-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.
