All Collections
Setup and Configuration
Google Tag Manager - Monsido Deployment
Google Tag Manager - Monsido Deployment

Add the Monsido script to Google Tag Manager

Updated over a week ago

This guide gives instructions on how to add the Monsido script to Google Tag Manager.

Article Navigation


Setup

This article gives one example of how to add the Monsido 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, see Setup and Install Tag Manager 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.

    Image of the Google Tag Manager landing page.

  2. Click New Tag/Add a new tag.

    Image of the Add a New Tag link.

    The tag creation pane slides open.

  3. In the name field, replace the text Untitled Tag with a name for the new tag.

  4. Click in the Tag Configuration section. The tag type list slides open.

    Image of the tag type list.

  5. Locate and select Custom HTML.

  6. The Tag Configuration pane opens. Paste the Monsido script into the Custom HTML section.

    Tip: See Add Script for instructions on how to compile the Monsido script.

    Image showing the location of the Custom HTML section of the tag configuration pane.

    Note: If only Consent Manager is needed, it is not a requirement to load the entire Monsido script. The minimum requirement for 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 pane slides open.

    Image showing the layout of the Choose a Trigger pane with triggers list.

  8. Click to select All Pages with type Page View.

    Image of the All Pages option.

    Note: It is possible to select specific pages instead of All Pages. This is useful to remember if some pages need to be excluded.

  9. Click Save to save the tag and activate it.


Advanced instructions

This section gives instructions on how to set up advanced configurations in Tag Manager to use with Consent Manager.


Add Triggers for Consent Manager tags

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

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, "Monsido Consent Manager Marketing Consented").

  4. Click in the Trigger Configuration section. The Trigger Type menu opens.

  5. In the Other section, choose Custom Event.

    Image showing the location of the Custom Event selection.

    The Trigger Configuration window opens.

    Image showing the Trigger Configuration window.

  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 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. The Tags window opens.

    The location of the Tags menu item on the left menu bar, and the Tags list that opens when it is selected.

  • Click New.

    The location of the New button on the top right corner of the page toolbar.

  • 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.

  • Select Custom HTML in the tag types list.

    The location of the Custom HTML option in the Custom section of the tag type menu.

    The Tag Configuration pane opens.

    The Tag Configuration pane.

  • 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 Monsido 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 gives instructions on how to create triggers in Google Tag Manager to use with the Monsido Consent Manager module.

In Google Tag Manager:

  1. On the menu on the left-hand side of the page, click Triggers. The Triggers page opens.

  2. Click New. The trigger configuration window opens.

  3. In the name field, type in a name (for example, "Monsido 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 trigger type in the list.

    The Trigger Configuration pane opens.

    The Trigger Configuration pane.

  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.
    ​

  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:

  • 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

For more information, see the article in Monsido for Developers:


Add Consent Checks to Tags (set triggers)

This section gives 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 heading.

    A new container opens.

    The new container with the trigger selections list.

  5. Select the trigger(s).

    When a trigger is selected, the field turns dark and the option to delete it appears on the row.

  6. Click Save. The tag creation window closes and the tag is on the list.


Exclude the Monsido Script on Specific Pages

This section gives instructions on how to exclude the Monsido script on specific pages using 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:

  • Click Tags in the menu on the left-hand side of the page. The Tags window opens.

    image showing the location of the menu for Tags and the Tags list.

  • Click the name of the tag to edit. The Tag configuration window opens.

    The Tags configuration pane.

  • Select a trigger in the Triggering section.

    The Triggering section, on the tag creation pane.

    The Trigger configuration window opens.

    The Trigger Configuration pane.

  • Click Edit (the pencil icon) to edit the trigger.

    • 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 Monsido tracking but keep Consent Manager

This question is concerning a setup where the tracking and compliance manager is deployed in a script via Google Tag Manager. This section gives instructions on how to opt out of the Monsido statistics tracking when using Monsido 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 will prevent the cookie from the 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:

      1. From the Monsido dashboard, navigate to the script setup section.

        For more information, see the User Guide chapter:

      2. Select only Statistics. Configure the module if needed.

        Note: if the module needs an edit, the new script must replace the old. It is normaily best to configure from the start.

        For more information, see the User Guide chapters:

      3. Add the HTML script to the tag created in Google Tag Manager.

    2. Get the Consent Manager script.

      1. Return to the Monsido dashboard and navigate to the script setup section again.

        For more information, see the User Guide chapter:

      2. 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 normaily best to configure from the start.

        For more information, see the User Guide chapter:

  5. Add the HTML script to the tag created in Google Tag Manager.

For more information, see the User Guide chapters:


Additional Resources

For more information, see the User Guide chapters:

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

For definitions and explanations of acronyms and abbreviations used in the Monsido User Guide, see:

For further assistance, contact the Monsido support team at support@monsido.com or use the Monsido chat and help features inside the application.

Image of the toolbar with the Help Center buttons highlighted.

Did this answer your question?