Cookie consent - configure tags in GTM

To control what cookies are set by third-party scripts (tags) running by Google Tag Manager (GTM), we need a method to disable or enable tags selectively. This method is called "Exception Triggers". This type of trigger can control the availability of any single tag using some conditions.

We are providing a snippet “Webmercs-consent-manager-GTM-snippet.json” with a set of pre-configured triggers for all supported cookie categories - "marketing", "performance", "functional", and "other". When one of these triggers is set to a tag, then the tag will be only enabled if the category is explicitly enabled in Webmercs Cookie Manager at a webshop.

Every single script tag (that is not necessary for the work of the webshop) should use an appropriate exception trigger based on the type of the script. For example, Hotjar is a marketing script, so the tag with the Hotjar script should use "Webmercs cookie consent - marketing disabled" exception trigger thus the Hotjar's script/tag will be disabled at the webshop until a user will enable it explicitly via Webmercs Consent Manager. The “Cookie declaration” page at a webshop contains the list of all scripts that use cookies and the purposes of those scripts (https://<webshop>/pages/cookie-declaration).

Step 1 - Import configuration

  • Go to the “Admin” tab and select the “Import Container” item

  • Select file “Webmercs-consent-manager-GTM-snippet.json” to import and choose the “Merge option

  • Click the “Existing” button to import into an existing workspace

  • Click the “Confirm” button

This action will create a folder “Webmercs cookie consent” and import 4 triggers and 2 variables into the folder

 

Step 2 - Set exception trigger for custom tags

  • For a tag that contains tracking, performance, or marketing scripts you should open a dialog to add a new trigger

  • Click “Add exception” button

  • Select one of the appropriate triggers preconfigured by Webmercs (for example, for a marketing script it should be a “Webmercs cookie consent - marketing disabled“)

  • The trigger should be added as an exception to prevent the loading of the tag when a condition is not met (the category is disabled by the user).

  • Click the “Save” button to save changes to a tag

  • Repeat this step for any specialized tag (like HotJar) or any “Custom HTML” tag that contains some script