You can use Google Tag Manager (GTM) to deploy the Demandbase Tag to your website without adding the code directly to your web pages. This article explains how to configure the tag and trigger in GTM.
Prerequisites to Deploy the Demandbase Tag via GTM
- You must have Admin privileges or be assigned to a permission set with the required Demandbase settings access.
You must have a Google Tag Manager account with Admin privileges.
Copy the Demandbase Tag Code
- In Demandbase, from the left navigation bar, go to
Settings > Demandbase-Wide Settings > Tag Configurations > Demandbase Tag tab.
- In the Your Demandbase Tag section, click Copy.
Create the Demandbase Tag in GTM
- In GTM, go to the Workspace Overview page, and click Add a new tag.
- Enter a name for the tag, such as My Demandbase Tag.
- Click the Tag Configuration card and select Custom HTML.
- In HTML box, paste the Demandbase Tag code snippet.
- Click Save.
- When prompted, click Save Tag.
Create a DOM Ready Trigger in GTM
Create a trigger to ensure the Demandbase Tag runs after the document object model (DOM) loads.
- In GTM, from the left navigation bar, click Triggers.
- Click New.
Enter a name for the trigger, such as All Pages After GTM.
- Click the Trigger Configuration card and select DOM Ready.
-
Select Some DOM Ready Events and configure the following conditions:
- Variable: Page URL.
- Operator: matches RegEx.
-
Value:
.*
Important: Include the period before the asterisk (.*) in the regular expression.
Click Save.
Tip: In most cases, you don't need to add more event conditions.
Assign the Trigger to the Demandbase Tag
In GTM, go to Workspace > Tags.
Select the Demandbase Tag you created.
Scroll down to Choose a Trigger and select the DOM Ready trigger you created.
- Click Save.
Publish the Demandbase Tag in GTM
- From the Workspace Overview page, click Submit.
Follow the prompts to publish your changes.
After publishing, GTM runs the Demandbase Tag on pages that match the trigger conditions.
Important: If your website uses a Content Security Policy (CSP), ensure that it allows the Demandbase Tag to load. See Check if Demandbase Tag is Blocked by CSP.