> 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

Littledata sends server-side events to your GA4 data stream through the Measurement Protocol API. To do this, it needs an API secret for that data stream. This page shows you how to create one.

{% hint style="info" %}
You only need to do this if you connect GA4 manually. If you connect by signing in with your Google account, Littledata creates the secret for you. It shows up in GA4 as **Littledata Server-Side Tracking**.
{% endhint %}

{% stepper %}
{% step %}
**Open your Data Stream**

In Google Analytics, go to **Admin** > **Data collection and modification** > **Data streams**, and open the web stream for your store.

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

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

Scroll down to the **Events** section 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-b3705afd2fcb3a67b6785d28612c25add7172f01%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-b719deffe9924f1ed00133e07f222dffc31371bf%2Fscreenshot-2023-07-24-at-11.10.54.png?alt=media)
{% endstep %}

{% step %}
**Name the secret**

Enter a nickname for the secret. We recommend "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.

{% hint style="warning" %}
Keep this value private. Only share it with Littledata.
{% endhint %}

![](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 %}
**Add the secret in Littledata**

When you connect GA4 manually in the Littledata app, paste the value into the **API secret** field.
{% endstep %}
{% endstepper %}

### Related articles

* [Create a Data Stream in GA4](https://help.littledata.io/integrations/shopify-to-google-analytics/create-a-data-stream-in-ga4)
* [Littledata to Google Analytics installation guide](https://help.littledata.io/integrations/shopify-to-google-analytics/littledata-shopify-install-guide)
