logo

Use custom Nimbu Consent Variables in Google tagmanager

This guide explains how to integrate Nimbu Consent Manager with Google Tag Manager, allowing you to control tag activation based on user consent preferences.

1

Navigate to settings

Navigate to settings
2

Click 'consent'.

Click 'consent'.
3

Copy the name of the consent setting you intend to use within Tag Manager.

Copy the name of the consent setting you intend to use within Tag Manager.
4

In Google Tag Manager, navigate to your project, and then go to the 'Variables' section.

In Google Tag Manager, navigate to your project, and then go to the 'Variables' section.
5

Create a new variable

Create a new variable
6

Assign a meaningful name to the variable. Then, select 'custom JavaScript macro' and add the following code: function() { return window.nimbuConsentManager.getConsent('name__NimbuConsent'); }. Finally, replace 'name__NimbuConsent' with the actual name of your Nimbu consent.

Assign a meaningful name to the variable. Then, select 'custom JavaScript macro' and add the following code: `function() { return window.nimbuConsentManager.getConsent('name__NimbuConsent'); }`. Finally, replace 'name__NimbuConsent' with the actual name of your Nimbu consent.
7

Create a trigger that is based on the created variable.

Create a trigger that is based on the created variable.
8

Apply the settings as shown in the screenshot.

Apply the settings as shown in the screenshot.
9

Choose the appropriate trigger for the tags you wish to activate.

Choose the appropriate trigger for the tags you wish to activate.
10

Click on "voorbeeld" to test your implementation.

Click on "voorbeeld" to test your implementation.