> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/integrations/shopify-to-google-analytics/create-a-measurement-protocol-api-secret-in-ga4.md).

# 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**:

![](/files/2Js7RGwBKFpQMl2k1wJk)
{% endstep %}

{% step %}
**Create a new API secret**

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

![](/files/EInTHCsYzQl4uzMNyCee)

![](/files/YhCiR1RNEudkdo3vaZUO)
{% 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.littledata.io/integrations/shopify-to-google-analytics/create-a-measurement-protocol-api-secret-in-ga4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
