# Google Analytics 4

### Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Google Analytics 4, you'll need to add your **Google Analytics Measurement ID** and **API Secret** so that Google Analytics 4 is a connected app within MESA.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FERasGNnrquHSkfI1YIVR%2Fimage.png?alt=media&#x26;token=1be7743d-aaef-49e5-928a-8ae0a9cc0d55" alt=""><figcaption></figcaption></figure>

Read the following to locate those 2 values. These next steps assume that you already have a Google Analytics 4 property. If you do not have one already, [please create one](https://support.google.com/analytics/answer/9744165#zippy=%2Cin-this-article).

1\. Sign in to your [Google Analytics Account](https://analytics.google.com/).

2\. Click on **Admin** from the left-hand sidebar.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FaS6a4knYXFymLE5zlcwr%2Fimage.png?alt=media&#x26;token=6f0f14aa-88b3-40c1-a84f-7b13152c9069" alt=""><figcaption></figcaption></figure>

3\. Ensure that you have the correct Account selected under **Account**.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2F28mPNSBe6rJO1619g93n%2Fimage.png?alt=media&#x26;token=99374f5a-d99f-42f6-ad6b-4ebfbe9ee72c" alt=""><figcaption></figcaption></figure>

4\. Ensure that you have the correct Property selected under **Property**.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FYiLzBpvjWVfLY3e0yW4v%2Fimage.png?alt=media&#x26;token=613a8170-9b8c-401f-957e-78164c74090e" alt=""><figcaption></figcaption></figure>

5\. Under Data collection and modification, select **Data Streams**.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FxcCtRFHiuGr3TEVxOajP%2Fimage.png?alt=media&#x26;token=c59ff24b-56fe-4807-82fb-de3ba2c5c871" alt=""><figcaption></figcaption></figure>

6\. Click on your preferred Data Stream. If you don't already have one, add a new stream.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FjbZZDWvJjsGJm0HFUFT6%2Fimage.png?alt=media&#x26;token=ca8ba198-8c91-49d2-8eea-c60dcce7bcff" alt=""><figcaption></figcaption></figure>

7\. Locate where it says **Measurement ID** in the Stream details section. Click on the copy icon.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FDEIwSK2oaiNK0y1V9NkG%2Fimage.png?alt=media&#x26;token=e24f92c3-98e1-4dba-934d-3258cc0bc91b" alt=""><figcaption></figcaption></figure>

8\. Paste the copied values into your MESA's GA4 Connection **Key** field.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FNan5midUX4UzM4U0bnU8%2Fimage.png?alt=media&#x26;token=a36a0550-2394-42fc-aa74-341abdbe1233" alt=""><figcaption></figcaption></figure>

9\. Next, scroll down on the same page until you see Events - **Measurement Protocol API secrets.** Click on it.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2F23kGb4vhxvEgDzGDGtpL%2Fimage.png?alt=media&#x26;token=35f968e9-cd04-45e9-b1cc-ad9c0c8085e4" alt=""><figcaption></figcaption></figure>

10\. Click on the copy icon next to your preferred API secret. If you do not have one already, please create one.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FaSUVxLAurH5Jgn3IaTKm%2Fimage.png?alt=media&#x26;token=d854e408-de4f-45c8-b335-52d9c248e416" alt=""><figcaption></figcaption></figure>

11\. Paste the copied values into your MESA's GA4 Connection **Secret** field.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FHJFVfT03kQjMB1YFphsK%2Fimage.png?alt=media&#x26;token=93566a28-0657-4c9d-9fb0-8059e91cb016" alt=""><figcaption></figcaption></figure>

12\. Click **Add Connection** and you are all set! You can now re-use the newly created connection and select it for your future workflows!

### Configure <a href="#configuring" id="configuring"></a>

#### Locate your Ecommerce events sent from MESA in Google Analytics <a href="#data" id="data"></a>

{% hint style="info" %}
**🗒 Important Note**: After your workflow triggers, it will take up to 24-48 hours to see data appear in the [Ecommerce purchase report](https://support.google.com/analytics/answer/12924131?visit_id=638062222372803843-2762436710\&rd=1) due to Google Analytics' processing times. You can use the [Realtime report](https://support.google.com/analytics/answer/9271392?hl=en\&ref_topic=9303476) to confirm that you're collecting data from your website or app successfully.
{% endhint %}

1\. In your Google Analytics account, click on **Reports**, then **Monetization**, and then **Ecommerce purchases** in the left sidebar.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2Fc2sLhpNp9g5idsx0M0x0%2Fimage.png?alt=media&#x26;token=fb66787a-7e44-45ac-9e65-ab97f1c1192c" alt=""><figcaption></figcaption></figure>

2\. You will be taken to the **Ecommerce purchases** report page where you can view different ecommerce events.

{% hint style="info" %}
**🗒 Note**: If you are not seeing the data from today, please adjust the view dates of your **Ecommerce purchases** report to include today's date by clicking on the [date range selector.](https://support.google.com/analytics/answer/1010052?hl=en)
{% endhint %}

![](https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2Fgit-blob-d0af7ed958dd4c4873213347f3b900a0d03556da%2Ffile-idlq07rg55.png?alt=media)


---

# 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.getmesa.com/connect/google-analytics-4.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.
