---
title: "Using Google Tag Manager with Web Governance"
date: "2021-09-08T08:35:42+00:00"
summary: "Learn how to deploy the Acquia Web Governance script using Google Tag Manager with these step-by-step setup configurations."
image:
type: "page"
url: "/web-governance/using-google-tag-manager-web-governance"
id: "be6bd474-944a-4cbd-87fb-19c34833209d"
---

Table of contents will be added

Setup
-----

This article provides an example of how to add the Web Governance script to Google Tag Manager. For any issues with Google Tag Manager, contact Google Support.

This section gives instructions on how to set up Google Tag Manager. For installation instructions, visit [Set up and Install Tag Manager](https://support.google.com/tagmanager/answer/6103696?hl=en&ref_topic=3441530) for instructions from Google on how to install Tag Manager.

1.  Log in to Google Tag Manager and access the account and workspace for the website.
    
    ![The landing page for a domain on Google Tag Manager.](https://acquia.widen.net/content/ad7d53da-f5d8-449f-8d1b-ee0b724178de/web/Mon_GoogleTagManager-Dashboard.png)
    
2.  Click **New Tag/Add a new tag**. The system displays the tag creation page.
    
    ![The location of the Add New Tag button/link on the Google Tag Manager dashboard.](https://acquia.widen.net/content/77e776e2-e621-4219-9793-3d97bdbbb6d5/web/Mon_GoogleTagManager-AddNewTagButton.png)
    
3.  In the name field, replace the text _Untitled Tag_ with a name for the new tag.
    
    ![The location of the Untitled Tag header on the top left side of the tag creation page.](https://acquia.widen.net/content/dadae3f9-ae7b-4daa-b653-017fde840df5/web/Mon_GoogleTagManager-TagCreation-UntitledTag.png)
    
4.  Click in the _Tag Configuration_ section. The tag type list expands.
5.  Locate and select **Custom HTML**.
    
    ![The choose tag type page, the description of the choices is in the document text.](https://acquia.widen.net/content/d166c45f-30fc-4d5e-ac57-60f8717301cf/web/Mon_GoogleTagManager-ChooseTagType.png)
    
6.  Paste the script into the _Custom HTML_ section. For detailed instructions on how to create the script, visit ​[Add the script](/node/58471).
    
    Note
    
    If only Consent Manager is needed, you do not need to load the entire script. The minimum requirement for the setup of Consent Manager is:
    
        <script type="text/javascript"> window._monsidoConsentManagerConfig = {
             token: "YOURTOKEN" 
        } 
        </script> 
        <script src="https://monsido-consent.com/v1/mcm.js" type="text/javascript">
    
7.  Click in the **Triggering** section. The _Choose a trigger_ page opens.
    
    ![The new container with the trigger selections list.](https://acquia.widen.net/content/f987d1ff-52df-4b8b-8132-ef66349fdd61/web/Mon_GoogleTagManager-NewTrigger.png)
    
8.  Click to select **All Pages** with type **Page View**.
    
    ![The All Pages option highlighted on the Choose a Trigger page.](https://acquia.widen.net/content/7f93b6eb-acab-4636-a3fc-72b8578c8720/web/Mon_GoogleTagManager-ChooseATrigger-AllPages-PageView.png)
    
    Note
    
    It is possible to select specific pages instead of **All Pages**. This is useful to remember if there are any pages that you need to exclude.
    
9.  Click **Save** to save the tag and activate it.

Advanced instructions
---------------------

This section provides instructions on how to set up advanced configurations in Google Tag Manager to use with Web Governance Consent Manager.

### Add triggers for Consent Manager tags

This section provides instructions on how to create triggers in Google Tag Manager to use with Consent Manager.

Follow these steps to add the trigger in Google Tag Manager:

1.  Click **Triggers** on the menu on the left-hand side of the page. The _Triggers_ page opens.
2.  Click **New**. The trigger configuration window opens.
3.  In the name field, type in a name (for example, "Consent Manager Marketing Consented").
4.  Click in the _Trigger Configuration_ section. The _Trigger Type_ menu opens.
5.  In the _Other_ section, choose **Custom Event**.
    
    ![The location of the Custom Event option, in the Other section of the Choose a Trigger Type page.](https://acquia.widen.net/content/8909b2fb-8d3a-4579-ade2-0b0b3c2d7afb/web/Mon_GoogleTagManager-ChooseATriggerType-CustomEvent.png)
    
    The _Trigger Configuration_ window opens.
    
    ![The location of the Custom Event option, in the Other section of the Choose a Trigger Type page.](https://acquia.widen.net/content/8909b2fb-8d3a-4579-ade2-0b0b3c2d7afb/web/Mon_GoogleTagManager-ChooseATriggerType-CustomEvent.png)
    
6.  In the _Trigger Configuration_ window, in the _Event name_ section, enter an event name, for example:
    
        cookie_consent_marketing
    
7.  Leave the other options set to the default value and then click **Save**.
8.  The dialog closes and the trigger is present in the list.
9.  Add a tag in Google Tag Manager for the trigger.

*   In Google Tag Manager, navigate to the _Workspace Overview_ page.
*   Click **Tags** in the menu on the left side of the page. 
*   Click **New** on the top right side of the page.
    
    ![The Tags list, with the Tags option in the left menu selected and the New button on the top right of the page selected.](https://acquia.widen.net/content/14bd259c-8f35-4e97-b7c2-78d8e9523526/web/Mon_GoogleTagManager-Events-TagsListButton-NewButton.png)
    
*   In the name field, type in a name (for example, "Marketing script").
*   Click in the _Tag Configuration_ field.
    
    ![The location of the Tag Configuration field on the tag creation pane.](https://acquia.widen.net/content/57f82402-94af-4192-979a-351f1fbb933d/web/Mon_GoogleTagManager-TagConfiguration.png)
    
*   Select **Custom HTML** in the tag types list.
    
    ![The location of the Custom HTML field on the tag creation page.](https://acquia.widen.net/content/b90ac332-a910-423f-b35e-203f6dcf70cd/web/Mon_GoogleTagManager-CustomHTMLField.png)
    
    The system displays the Tag Configuration page.
    
    ![The location of the Custom HTML field on the tag creation page.](https://acquia.widen.net/content/b90ac332-a910-423f-b35e-203f6dcf70cd/web/Mon_GoogleTagManager-CustomHTMLField.png)
    
*   In the HTML field, type in the script. For example:
    
        <script>
          //Marketing script requires that marketing cookie category consent is given
        </script>
    
*   Click **Save**. A dialog box opens with the message "No Triggers Selected".
*   Click **Add Trigger** and select the trigger that was just created.
*   Click **Save**. The tag creation window closes and the tag is on the list.
*   To create other types of triggers, replace `cookie_consent_marketing` with:
    *   `cookie_consent_all` : All-purpose consent given
    *   `cookie_consent_essential` : Essential consent given
    *   `cookie_consent_basic` : Basic interactions and functionalities purpose consent given
    *   `cookie_consent_marketing` : Marketing (targeting and advertising) purpose consent given
    *   `cookie_consent_analytics` : Analytic purpose consent given
    *   `cookie_consent_personalisation` : Personalization (Experience enhancement) consent given.

### Add triggers to control cookies

Google Tag Manager includes some features that determine how the tags behave in response to the end-user cookie consent choices.

Some tags can set cookies. In order for the Consent Manager solution to retain those tags, triggers need to be created and set on those tags. The trigger retains the tag until the user interacts with the banner, by opt-out or opt-in.

This section provides instructions on how to create triggers in Google Tag Manager to use with Consent Manager.

In Google Tag Manager:

1.  Click **Triggers** from the menu on the left side of the page. The _Triggers_ page opens.
2.  Click **New**. The trigger configuration window opens.
3.  Type a name in the _Name_ field (for example, "Consent Manager Marketing Consented").
4.  Click in the _Trigger Configuration_ section. The _Trigger Type_ menu opens.
5.  Choose **Custom Event**.
    
    ![The location of the Custom Event option, in the Other section of the Choose a Trigger Type page.](https://acquia.widen.net/content/8909b2fb-8d3a-4579-ade2-0b0b3c2d7afb/web/Mon_GoogleTagManager-ChooseATriggerType-CustomEvent.png)
    
    The _Trigger Configuration_ pane opens.
    
    ![The location of the Custom Event option, in the Other section of the Choose a Trigger Type page.](https://acquia.widen.net/content/8909b2fb-8d3a-4579-ade2-0b0b3c2d7afb/web/Mon_GoogleTagManager-ChooseATriggerType-CustomEvent.png)
    
6.  Enter an event name, for example: `cookie_consent_marketing`.
7.  Leave the other options set to the default value.
8.  Click **Save**.
9.  The dialog closes and the trigger is present in the list.
    
    To create other types of triggers, replace `cookie_consent_marketing` with:
    
    *   c`ookie_consent_all`: All-purpose consent given
    *   `cookie_consent_essential`: Essential consent given
    *   `cookie_consent_basic`: Basic interactions and functionalities purpose consent given
    *   `cookie_consent_marketing`: Marketing (targeting and advertising) purpose consent given
    *   `cookie_consent_analytics`: Analytic purpose consent given
    *   `cookie_consent_personalisation`: Personalization (Experience enhancement) consent given

For more information, visit [Consent Manager Attributes](/node/58256/).

### **Add consent checks to tags (set triggers)**

This section provides an example of how you can use Google Tag Manager to set up triggers for consent checks on tags.

1.  In Google Tag Manager, navigate to the _Workspace Overview_ page.
2.  Click **Tags** in the menu on the left-hand side of the page. The _Tags_ window opens.
3.  Select the tag that sets cookies.
4.  Scroll down into the _Triggering_ section and click **Edit** (icon of a pencil) on the top right corner of the page.
    
    ![The location of the Edit icon on the top right corner of the page, in line with the page title.](https://acquia.widen.net/content/9e7694e3-dada-4057-8d21-c890309413a8/web/Mon_GoogleTagManager-TriggeringEditButton.png)
    
    The system opens a new container.
    
    ![The new container with the trigger selections list.](https://acquia.widen.net/content/f987d1ff-52df-4b8b-8132-ef66349fdd61/web/Mon_GoogleTagManager-NewTrigger.png)
    
5.  Select the trigger(s).
    
    ![The location of the option to delete a trigger that is selected. When a trigger is selected, the field turns dark and the option to delete it appears on the row.](https://acquia.widen.net/content/e5c3833d-b89f-4d63-ac2a-30a97102e9a8/web/Mon_GoogleTagManager-SelectTrigger.png)
    
6.  Click **Save**. The tag creation window closes and the tag is on the list.

### Exclude the script on specific pages

This section provides instructions on how to exclude the script on specific pages with Google Tag Manager.

For example, if a trigger exception is set to "_Page URL equals thankyou.html_", the tag will never fire on the page "_thankyou.html_".

_Tip_: Use advanced Tag Sequencing settings to cause the tag to ignore its own triggers and instead fire as part of the sequence.

To remove a trigger from a tag configuration, or to create an exception:

1.  Click **Tags** in the menu on the left side of the page. The _Tags_ window opens.
    
    ![The Tags list, with the Tags option in the left menu selected and the New button on the top right of the page selected.](https://acquia.widen.net/content/14bd259c-8f35-4e97-b7c2-78d8e9523526/web/Mon_GoogleTagManager-Events-TagsListButton-NewButton.png)
    
2.  Click the name of the tag to edit. The _Tag configuration_ window opens.
    
    ![The location of the Untitled Tag header on the top left side of the tag creation page.](https://acquia.widen.net/content/dadae3f9-ae7b-4daa-b653-017fde840df5/web/Mon_GoogleTagManager-TagCreation-UntitledTag.png)
    
3.  Select a trigger in the **Triggering** section.
    
    ![The Tag Configuration and Triggering sections on the new tag creation page.](https://acquia.widen.net/content/6bf89a3b-a918-4537-9628-59ac785effee/web/Mon_GoogleTagManager-TagCreation-TagConfigurationAndTriggeringSections.png)
    
    The system displays the _Trigger configuration_ window.
    
    ![The Trigger Configuration page. The fields are described in the document text.](https://acquia.widen.net/content/a5ca9a47-41df-46b2-a4ba-01ddc381281e/web/Mon_GoogleTagManager-TriggerConfigurationPage.png)
    
4.  Click **Edit** (the pencil icon).
    *   To _add a trigger:_ Click **Add** (the plus sign icon) in the _Firing Triggers_ section. The existing triggers list opens. Click to select a trigger from the list to add.
    *   To _remove a trigger,_ click **Remove** (a minus sign icon) on the same row as the trigger to remove in the _Firing Triggers_ section.
    *   To add a trigger exception, click on the link **Add Exception**. If any exceptions already exist, click **Add** (the plus sign icon). The existing triggers list opens. Click to select a trigger to exclude. The trigger is added to the Exceptions section on the _Trigger Configuration_ page.
    *   To _remove a trigger exception_, click **Remove** (a minus sign icon) on the same row as the trigger to remove in the _Exceptions_ section.

### How to opt out of tracking but keep Consent Manager

This question is concerning a setup where the tracking and compliance manager is deployed in a script through Google Tag Manager. This section provides instructions on how to opt out of statistics tracking when you use Consent Manager.

1.  Create two custom tags in Google Tag Manager.
    *   One tag for the Statistics script
    *   One tag for the Consent Manager script.
2.  Set both tags to run on all pages.
3.  Set a trigger on Statistics (for example, on Analytics).
    
    Important
    
    Make sure to set Statistics as the first tag to fire. The trigger "analytics" prevents the cookie from statistics to fire. That trigger only fires if the user accepts all cookies or analytics.
    
4.  Add the HTML script to the tag created in Google Tag Manager.
    1.  Get the **Statistics** script:
        *   From the dashboard, navigate to the script setup section. For instructions, visit [Add the script](/node/58471).
        *   Select only **Statistics**. Configure the module if needed.
            
            Note
            
            If the module needs an edit, the new script must replace the old. It is normally best to configure from the start.
            
            For more information, visit [Statistics setup](/node/60241).
            
        *   Add the HTML script to the tag created in Google Tag Manager.
    2.  Get the **Consent Manager** script.
        *   Return to the Web Governance dashboard and navigate to the script setup section again. For more information, visit [Add the script](/node/58471).
        *   Select only **Consent Manager**. Configure the module if needed.
            
            Note
            
            If the module needs an edit, the new script must replace the old. It is normally best to configure from the start.
            
            For more information, visit [Consent Manager setup](/node/81751).
            
5.  Add the HTML script to the tag created in Google Tag Manager.

Additional resources
--------------------

For instructions from Google on how to install Tag Manager, visit:

*   [Set up and Install Tag Manager](https://support.google.com/tagmanager/answer/6103696?hl=en&ref_topic=3441530)
*   [Google Tag Manager developer guide](https://developers.google.com/tag-manager/devguide?hl=nl).