> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/connect/google-analytics-4.md).

# 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&amp;token=1be7743d-aaef-49e5-928a-8ae0a9cc0d55" alt="Screenshot of the Google Analytics 4 connection panel in the MESA workflow builder. Spotlight the Measurement ID and API Secret fields."><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&amp;token=6f0f14aa-88b3-40c1-a84f-7b13152c9069" alt="Screenshot of the Google Analytics dashboard. Spotlight the Admin link in the left-hand sidebar."><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&amp;token=99374f5a-d99f-42f6-ad6b-4ebfbe9ee72c" alt="Screenshot of the Google Analytics Admin settings. Spotlight the Account selector."><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%2FW83tvg5bhTNy47KGsPbz%2Fimage.png?alt=media&amp;token=987bebee-3373-4780-87bc-40aa6408b989" alt="Screenshot of the Google Analytics Admin settings. Spotlight the Property selector."><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&amp;token=c59ff24b-56fe-4807-82fb-de3ba2c5c871" alt="Screenshot of the Google Analytics Admin settings under Data collection and modification. Spotlight the Data Streams option."><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&amp;token=ca8ba198-8c91-49d2-8eea-c60dcce7bcff" alt="Screenshot of the Google Analytics Data Streams page. Spotlight your preferred data stream."><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&amp;token=e24f92c3-98e1-4dba-934d-3258cc0bc91b" alt="Screenshot of the Google Analytics Stream details page. Spotlight the Measurement ID copy icon."><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&amp;token=a36a0550-2394-42fc-aa74-341abdbe1233" alt="Screenshot of the MESA Google Analytics 4 connection panel. Spotlight the Key field."><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&amp;token=35f968e9-cd04-45e9-b1cc-ad9c0c8085e4" alt="Screenshot of the Google Analytics Stream details page under Events. Spotlight the Measurement Protocol API secrets option."><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&amp;token=d854e408-de4f-45c8-b335-52d9c248e416" alt="Screenshot of the Google Analytics Measurement Protocol API secrets page. Spotlight the copy icon next to your API secret."><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&amp;token=93566a28-0657-4c9d-9fb0-8059e91cb016" alt="Screenshot of the MESA Google Analytics 4 connection panel. Spotlight the Secret field."><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&amp;token=fb66787a-7e44-45ac-9e65-ab97f1c1192c" alt="Screenshot of the Google Analytics Reports section. Spotlight the Monetization then Ecommerce purchases options in the left sidebar."><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 %}

![Screenshot of the Google Analytics Ecommerce purchases report showing ecommerce events sent from MESA. Spotlight the ecommerce events table.](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)
