# Google Analytics 4 Setup

The existing workflow action for Google Analytics in the our software system includes both Google Analytics 4 and Universal Analytics, which means that users can choose to use either platform or both to track their marketing campaigns and website traffic. This provides a more flexible and integrated approach to tracking and analyzing user behavior, which can help businesses make data-driven decisions to improve their marketing strategies and user experience.

### **Create or use an existing Google Analytics Workflow**

In your Google Analytics Workflow, select the action 'Add to Google Analytics.'

A new dropdown value under 'Action Type' has been introduced by the name 'Google Analytics 4'; select this from the dropdown.

{% embed url="<https://lh6.googleusercontent.com/IVk4Cw_JxDUrtSu8PsQQgUlDsFXBnDya9lFOxxNeulJdK2-LO07U9L87i3OWVXcRHXSZvwb4bVnU0HNNGBAQhkDBnGHvsYn0vcrRLgoR3ySW-KGjNYvVWs7QE5AVENTjgKUUHnGQnFO4mqVCSDLk_1U>" %}

### **Get a Measurement ID from your Google Analytics Data Stream**

Go to your [Google Analytics account](https://analytics.google.com/analytics/web/provision/#/provision) and fetch the measurement-id from **Admin ➝ Account Settings ➝ Data Stream ➝ Select the Data Stream.** (Please refer to Google help documentation on [how to Set up Google Analytics](https://support.google.com/analytics/answer/9304153?hl=en) if you do not have it set up.)

{% embed url="<https://lh4.googleusercontent.com/nOP_Qgn23Z6dCQjBiiQkGJpha0oTOBUwfkKachgB7WoNbXtVTa1Fl8q3xqh73ZQQZdJvBqmMD3RO7KswnWETbaQgwGz9lU57kqlgEQeHWiJrz-Wwfdss5QprUZwpivy6jtcZ96j1SkeIGYLwGmk7p0Y>" %}

{% embed url="<https://lh4.googleusercontent.com/YrnCdaUy2d3TDqkll3GWL-pAOUC6901RyaXjPpE6BMTQVY7QXdL91RznBDPe0-9a1kP6OKWZjnP2WwIFABz1GAXtIQ5CZf_WzZdHbsCgBzWCbcZfZz0yThQ3g332q5w3KfNqF-qjAAvnhydLvYCT2Mg>" %}

Copy the Measurement ID for your desired Data Stream:

{% embed url="<https://lh6.googleusercontent.com/1Yi-zuaAJ2Hl3s9fGVoV8yuNVfv2rpcKxG5ML_tNpdj6s15QUTFFHqY9UXN_Sdu1erbpDpyQU0V-3kJniqbkynZC1dVNiNPtuAiXNG9ZQxU2qR2oac-l53oTxvK5PxkfvE_FBkeYn0XwqaqeqxT-0_4>" %}

Paste the Measurement ID in the Measurement ID field of your Google Analytics Action in your workflow.

{% embed url="<https://lh6.googleusercontent.com/OxapoNyK9sWpnqolOj6usBLGIsP64SM7jsNYjpxuMfajUaYHbsAl2jca7WUsxy7RjFj3I8WGUwmzPuXcPBM4G_3chH4UXsLwpn1Y9ghU0RRDxR5KriTsfGhUuoAGBu35h9B5lURlMKkFV0DsHUcxGAU>" %}

### **Create a Google Analytics event that you want to track**

You can Add the event name that you wish to track. This event name will show up under the Google Analytics dashboard along with other standard events that are set up.

### **Get an API Secret Value from your Data Stream**

Add the API secret by navigating to your Google Analytics account **Admin ➝ Account Settings ➝ Data Stream ➝ Select the Data Stream ➝ Measurement Protocol API secrets.**

{% embed url="<https://lh4.googleusercontent.com/QNBfz2DmvY4TL9hdz7QtjA2wXgc4GIEc44XUEnMyuaT77nTZ5nfz2Q1IgAJAg_JdTJJYwo8Sk1qn9gP3GFLJTHyVboVb9K1WTA06RfkX0rz0CQ-orupSqL4FpQKHAKGYMOIbVg_vNdaOo_T-g7oirrg>" %}

{% embed url="<https://lh3.googleusercontent.com/HxT1dWuj_1Ia5JaafObdJkDK7n9Y6gnBZR51Lee-27jhq-MNk6JNm25fPzp_H3p1CNWfS5eckmZtlBqdvVawunEEuk5DjMlpoBGhaUJ6wKlp3n_ejnmPVlw-8-KmFq7pIS8sO8oWyKBISWnhx0qLH1U>" %}

{% embed url="<https://lh3.googleusercontent.com/4IO-ZPgHf7ZwXV_l3tZI0r3bdDPHYJxJHnTwGQBqFjSbwG3XPccv46LmiEsqPv2xXszk1r8XnysDASMAGQEf25u3OPiRX2y6kNeviME9R_gFLbPr2FyChy_Fkcy4EM7LyKFvNqLiUsJ5XO7TZhp3IgM>" %}

**Please Note:**

Before an API Secret can be created you need to acknowledge that you have completed the necessary privacy discussions and rights from your end users for the collection and processing of data.

{% embed url="<https://lh6.googleusercontent.com/2wgosWeRKlJkfQYk2z7AOiP78YJotqH9oLTJbEfJckWcQlxkU5LeLI67Z-O_gZeTjaRwW7BahWMMKLfmAcQXDkZcxBGI7KrH6JRTZg9CrYfDsLNo-HtmxPKS0eutsB7yrTlk3hRhuvlyKyyh4LQ4zy0>" %}

Then click on Create if no API Secret has already been created.

{% embed url="<https://lh3.googleusercontent.com/Sx87XEEF8flolb-7d6KN0i5exfnd8kSzP9zuiCEh1aXPBXwBg--j3FEZWK2TpH1fAnHEJjHC4CSqWRwMEJ3ctszpoebVdfmLuqjqJUpROIi5yInCVKSFrX8i4IHD7djFVbX8HWsRZwpfyTflPV9Zs4k>" %}

Name your API secret and then hit **Create,** and a Secret Value will be generated for it automatically.

{% embed url="<https://lh6.googleusercontent.com/zwi2xkBQPD3HEBhrkTLZCbxelocQ1P8LGl_LnpcuXklm7bF7QRs_J74fgl9v5Ds9Dqm3gyfVTx65asB5nBxKYtjmzUYnVl6r2uXBDwRVV_bMzajsqiTvyhOu5sgrpYDStjaN91vJe7EamW9HT52S33I>" %}

{% embed url="<https://lh6.googleusercontent.com/wR1xUuKUwmiQO1XADruMyRXIjltQbRa4gnUVICoYumLH_SIJroLXISalxKDNHfWpMDdE7tY_W6QpkTFjTgmip8nEI-IK8QfEqsgzLTOH0mdxKCk0_mcHKWUn21cznI0v4fBAYOcGC0Bes0Ko9oCr0T4>" %}

Copy the Secret Value from here and paste it into the API Secret field in the Google Analytics action in your Workflow.

{% embed url="<https://lh5.googleusercontent.com/lSbpYJUq25fZLRi4Th1IC5g-pQ5ZY1uHCJ4qRr4uIbAwpsKoSUX62l57lN0gowP2nX7NOJ663865ikgMExikMpJhZfjnbBWkmuemvU3epkrt1LQtlKpSg_dPW-_N1FKAgpc_sMVxUIbSXFy8t3_5Lzs>" %}

**Save Action** and then **Save the Workflow**. **Publish** if you are ready to use it.


---

# 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://software-help-docs.gitbook.io/knowledge-base/software-guide/integration-and-widget/google-analytics-4-setup.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.
