1. N.Rich Knowledge Base
  2. Website Tag Installation

N.Rich Tag Installation using Google Tag Manager & Cookiebot CMP.

This guide aims to help in the N.Rich Tag installation if you are using Cookiebot CMP and Google Tag Manager together.

Overview

This guide will help you set up N.Rich tag so that it works in tandem with Cookiebot CMP and complies with your cookie management policies. This guide assumes that you are familiar with basic Google Tag Manager concepts and Cookiebot CMP is already installed on your website

This setup involves creating two tags:

  1. N.Rich Bootstrap Tag: A “safe” tag that initializes the N.Rich script without enabling cookies, allowing it to fire before user consent is granted.

  2. N.Rich Allow Cookies Tag: This tag activates only if the user grants marketing consent, allowing N.Rich to use cookies for advanced tracking.

By following these steps, you’ll ensure the N.Rich tag complies with GDPR and other privacy regulations while delivering effective marketing data.

Getting Started

The implementation of the N.Rich Website Tag is divided into three steps to ensure proper functionality and compliance with consent management. Each step is essential for a compliant and effective implementation. Follow the steps carefully to set up the N.Rich tag.

Step 1 (optional): Creating Trigger in GTM

This part is optional because you might already created such a trigger for other tags before. Before starting with it please check if you already have this trigger in Triggers list

Here we are going to create a trigger, which would be used to allow N.Rich tag to use cookies. Basically it’s a short summary for the Conditionally loading tags in Google Tag Manager article, so in case any troubles you could check the original article from Cookiebot.

Creating Cookie Consent variable

In the Template Gallery you can find a variable that can be used to determine if consent has been given for a certain cookie category (preferences, statistics, marketing).

The variable essentially reads the consent state from the CookieConsent cookie set by the Cookiebot script when a visitor submits consent via the banner, constructs a string, and returns it.

  1. Import Cookie Consent variable.

    • Click "Templates" ❯ "Variable Templates" ❯ "Search Gallery" and select "Cookiebot Consent State" from the list of community variable templates.

    • Click "Add to workspace" and confirm by clicking "Add".

  2. Add a new User-Defined Variable and name it "Cookie Consent" by creating a new Variable and selecting "Cookie Consent State" from the list of standard variables. No configuration is available or needed.

Creating Marketing Consent Granted Trigger

This trigger could be used later by any tags if Marketing consent is required for them to fire.

  1. In the left-hand menu, go to Triggers and click New.

  2. Select Custom Event as the trigger type.

  3. Name the trigger (e.g., Marketing Consent Granted ) and configure it to match the consent event fired by Cookiebot - cookie_consent_marketing.

  4. For “This trigger fires on“ choose “Some Custom Events

  5. For “Fire this trigger when an Event occurs and all of these conditions are true” choose: “Cookie consent“ contains marketing.

  6. Save the trigger.

Google Tag Manager Cookie Consent

Step 2: Creating N.Rich Bootstrap Tag

The N.Rich Bootstrap Tag initializes the N.Rich script in its safe mode (cookies disabled) and must fire on all pages. Follow these steps to create it:

  1. Create a new tag.

    • In the left-hand menu of GTM, go to Tags and click New.

    • Click Tag Configuration and select Custom HTML.

  2. Add the N.Rich code.

    • Obtain the N.Rich script from your N.Rich platform account.

    • Copy the script and paste it into the HTML box in GTM.

  3. Set the trigger.

    • Under Triggering, click Add Trigger.

    • Select the existing All Pages trigger.

  4. Save the tag.

    • Name the tag (e.g., “N.Rich Bootstrap”) and save it.

Google Tag Manager N.Rich Bootstrap Tag

Step 3: Create the N.Rich Allow Cookies Tag

The N.Rich Allow Cookies Tag allows the N.Rich script to use cookies, ensuring it only fires when the user grants marketing consent. Follow these steps to set it up:

  1. Create a new tag in GTM.

    • In the left-hand menu of GTM, go to Tags and click New.

    • Click Tag Configuration and select Custom HTML.

  2. Add the N.Rich Marketing code.

    • Copy the following code and paste it into the HTML box:

      <script> window._nrich = window._nrich || []; window._nrich.push(["enableCookies",true]); </script>
  3. Set the trigger for marketing consent.

    • Under Triggering, click Add Trigger.

    • Choose Marketing Consent Granted trigger which was created in Step 1.

  4. Save the tag.

  • Name the tag (e.g., “N.Rich Allow Cookies”) and save it.

Google Tag Manager N.Rich Allow Cookies Trigger

Step 4: Test Your Implementation

Before publishing your changes, we strongly recommend testing your setup using Preview Mode in Google Tag Manager. This helps ensure that everything works as expected and prevents issues caused by misconfiguration or conflicts.

  1. Enable Preview Mode.

    • In GTM, click Preview in the top-right corner to activate Preview Mode.

  2. Verify the tags.

    • Navigate to your website while Preview Mode is active.

    • Use the GTM debugging panel to confirm that:

    • The N.Rich Bootstrap Tag fires on all pages.

    • The N.Rich Allow Cookies Tag fires only when marketing consent is granted.

  3. Check for conflicts or errors.

    • Ensure both tags load without errors or conflicts with other scripts on your website.

  4. Publish the changes.

    • Once you’ve verified the setup, return to GTM and click Submit to publish your container.