> For the complete documentation index, see [llms.txt](https://docs.sfbx.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfbx.io/configuration/step-3-notice-implementation-web-app-tv/google-gtm/manage-google-analytics.md).

# Manage Google Analytics

Google Analytics management is integrated into the CMP using the GCM (Google Consent Mode) protocol. GCM blocks Google Analytics from depositing cookies or scripts before the user consent. The CMP may continue to block Google Analytics after the user's consent, depending on the user's choices.

On this page you'll find information on how to manage Google Analytics with AppConsent, depending on your implementation.

## Implementing and configuring Google Analytics with GTM

### Measurement ID retrieval

Before implementing Google Analytics, you need to retrieve your measurement ID. To do this, you need :

1. Go to on your Google Analytics dashboard <https://analytics.google.com/>
2. In the left-hand side panel, click on **Admin**

<figure><img src="/files/nlHjUBg6tVQBusEGDPiZ" alt=""><figcaption></figcaption></figure>

3. In the page, find the section **Data collection and modification**
4. Then click on **Data streams** menu

<figure><img src="/files/5XSlPPrXFsLAH3nGi11b" alt=""><figcaption></figcaption></figure>

5. Click on data stream you wish to integrate to open the stream details
6. And copy measurement ID using the button

<figure><img src="/files/o9aphgvaWLQIIBFeHBog" alt=""><figcaption></figcaption></figure>

### Implementing Google Analytics with GTM

1. Return on Google Tag Manager
2. On the left-hand side panel, click on the **Tags** menu
3. Then click on **New** button

<figure><img src="/files/wWooRYJtHb221967aU58" alt=""><figcaption></figcaption></figure>

4. Click on **Tag configuration** section
5. Then in the left-hand side panel, select **Google Analytics**

<figure><img src="/files/YEMPLHPYhWJ5fy4Xsc8G" alt=""><figcaption></figcaption></figure>

6. The click on **Google tag** template

<figure><img src="/files/uFWjiE5pLfmgfTjZrU38" alt=""><figcaption></figcaption></figure>

7. Paste the previously copied ID (see above) into **Tag ID** field

<figure><img src="/files/ZDxiztGBu69j1d2FYtap" alt=""><figcaption></figcaption></figure>

8. In the accordion **Consent Settings** located in **Advanced Settings**, you can see that your tag is already ready to use Google Consent Mode signals

<figure><img src="/files/6TX11W47BZUhTK17JhCO" alt=""><figcaption></figcaption></figure>

9. In triggering section, add the **All Pages** trigger

<figure><img src="/files/tnHYIzF87HBcNgKmm3M9" alt=""><figcaption></figcaption></figure>

10. Then, name and save the tag

## AppConsent configuration for Google Analytics (Google Consent Mode Advanced Mode - GCMv2)

For Google Analytics to be controlled by the CMP, GCM (Google Consent Mode) must be activated in the notice configuration and in the notice implementation (code or GTM).

For more information on implementing Google Consent Mode, see the page: [Setting up Google Consent Mode v2](/configuration/step-3-notice-implementation-web-app-tv/web-cmp/setting-up-google-consent-mode-v2-for-google-analytics-and-google-ads.md)


---

# 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://docs.sfbx.io/configuration/step-3-notice-implementation-web-app-tv/google-gtm/manage-google-analytics.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.
