If you use Google Tag Manager (GTM) to install the RB2B script, you can use GTM's built-in Consent Mode to ensure the tag only fires after a visitor has given consent. This keeps your implementation compliant with privacy regulations such as GDPR.
Before you start
This guide assumes:
You have a GTM container already installed on your website
Your consent management platform (CMP) is integrated with GTM's Consent Mode and is configured to update consent signals when a visitor accepts or declines
Your CMP pushes a
consent_updateevent (or equivalent) to the GTM data layer on acceptance
If your CMP is not yet integrated with GTM Consent Mode, check your CMP's documentation first. GTM's Consent Mode only works if something is actively updating the consent state.
Step 1: Open the RB2B tag in GTM
Log in to tagmanager.google.com and open your container.
Go to Tags in the left navigation.
Find your RB2B tag and click to open it. If you have not created it yet, create a new tag using the Custom HTML tag type and paste in your RB2B script.
Step 2: Add consent checks to the tag
In the tag configuration panel, scroll down to Consent Settings and expand it.
Click Add required consent.
Select the consent type that covers tracking or analytics. The most common choice is
analytics_storage. If your CMP uses a custom consent type (for example,ad_storageor a custom string), use that instead.Set the requirement to Granted.
This tells GTM not to fire the tag unless the specified consent type has been granted.
Step 3: Set the trigger
The tag still needs a trigger to know when to fire. You have two options depending on your setup:
Option A: Fire on Page View after consent (simplest)
If your CMP grants consent before GTM's Page View fires (common when returning visitors already have consent stored), you can use the standard All Pages trigger. GTM will automatically withhold the tag until consent is granted.
Option B: Fire on a consent update event
If consent is granted during the session (for example, a first-time visitor accepts the cookie banner), you need a trigger that fires after acceptance:
Go to Triggers and create a new trigger.
Set the trigger type to Custom Event.
Enter the event name your CMP fires on acceptance. Common examples:
consent_update,cookieyes_consent_update, orOneTrustGroupsUpdated. Check your CMP's documentation for the correct event name.Save the trigger and attach it to the RB2B tag.
Using both triggers together (All Pages and the consent update event) is a safe approach: it covers returning visitors on page load and new visitors who accept mid-session.
Step 4: Test before publishing
Click Preview in GTM to open the Tag Assistant debugger.
Open your website in the preview session.
Without accepting consent, confirm the RB2B tag shows as Not Fired or Blocked by consent.
Accept the consent banner and confirm the tag fires.
If the tag does not fire after acceptance, check that your CMP is correctly pushing consent signals to the data layer. In Tag Assistant, look for a
consentevent orgtm.consentin the data layer panel.
Step 5: Publish
Once testing confirms the tag behaves correctly, submit and publish your GTM container.
A note on "consent initialisation"
GTM fires tags in two phases: consent initialisation (before consent state is known) and the standard firing phase (after consent is resolved). The RB2B tag should not be set to fire during consent initialisation. If you see a Consent Initialization trigger option in your tag settings, do not use it for the RB2B tag.
