Before you start
- Create and save a consent setup. See Create a Consent Banner.
- Use Publish Live on the Consent list at least once. Until then the live configuration does not exist and the banner cannot load on your site.
- All the snippets below are on the setup's edit page, in the right-hand Install On Your Site panel. They already contain the setup's id; copy them from there rather than typing them.
Option 1: paste the script on your site
- Open Shield > Consent and click the setup's title.
- In Install On Your Site, click Copy Snippet.
- Paste it as the first script inside
<head>on every page, above Google Tag Manager or gtag. That order is what lets the consent defaults reach Google tags before they fire.
The snippet looks like this, with your setup's id in place of YOUR_SETUP_ID:
<script src="https://cdn.tagpipes.com/shield/cmp/v1/cmp.js" data-config="YOUR_SETUP_ID"></script>
If Emit Consent Mode v2 signals is off for this setup, the snippet also carries data-gcm="off". Keep it exactly as copied.
Option 2: deploy through a tag manager
Use this when you cannot edit the site's HTML.
| Tag manager | What to do |
|---|---|
| Google Tag Manager | Nothing to paste. AutoTag deploys a "TagPipes Shield CMP" custom template that sets the consent default during Consent Initialization, then loads the banner |
| Adobe Launch | Click Copy Tag Manager Snippet and paste it into a Custom Code action on Library Loaded (Page Top), order 1 |
| Tealium | Click Copy Tag Manager Snippet and paste it into the Pre-Loader |
| Your own injection code | Paste the tag manager snippet into the earliest slot, before any Google tag |
When Consent Mode is on, the snippet sets the consent default and loads the banner with a gcm=seeded marker. The two must ship together. Without the marker, the banner treats the default as another consent tool's, steps aside, and the visitor's choice never reaches Google.
Embed the cookie list on your privacy policy
- In Cookie List For Your Privacy Policy (or Privacy Policy Embed on the Cookies & Storage page), click Copy Snippet.
- Paste it where the cookie table should appear on your privacy or cookie policy page.
<div id="tp-declaration"></div>
<script src="https://cdn.tagpipes.com/shield/cmp/v1/declaration.js" data-config="YOUR_SETUP_ID"></script>
The table lists every category and item from the live configuration, in the visitor's language, and updates on every Publish Live. Nothing shows until the setup has been published live. Manage what it lists on Cookies and Storage.
Use the banner from your own code
Once the banner script is on the page, it exposes window.TagPipesShield:
| Call | What it does |
|---|---|
TagPipesShield.open() | Opens the preference center. Use it for your own "Your Privacy Choices" footer link |
TagPipesShield.getConsent() | Returns the current consent state, or null while the banner is still working out the visitor's region and choices |
TagPipesShield.isReady() | true once the consent state is known |
TagPipesShield.onReady(fn) | Calls fn with the consent state as soon as it is known, or right away if it already is |
TagPipesShield.rejectAll() | Applies the most protective choice: every optional category off, plus the opt-out of personalized advertising outside opt-in mode. Returns false if the state is not known yet |
TagPipesShield.consentId() | The browser's consent id, once it has one |
TagPipesShield.setIdentity({ em: "<hashed email>" }) | Links this browser's decisions to a known person. See Consent Graph |
The page also receives a tpshield:consent event on document each time the consent state is announced.
Check it worked
- Open your site in a private window. The banner appears for a visitor who has not decided yet.
- Make a choice, then open Consent Analytics for the setup. Decisions appear after the next summary run, within about 15 minutes.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| No banner at all | The setup has never been published live. Click Publish Live on the Consent list |
| No banner for some visitors | Expected when the visitor already decided, or is outside every covered region and Visitors outside covered regions is No banner |
| Banner shows old text | You saved but did not publish. Saving updates the preview only |
| Google tags fire before consent is set | The script is not the first one in <head>. Move it above Google Tag Manager or gtag |
| Consent choices never reach Google through Adobe Launch or Tealium | The tag manager snippet was edited or split. Paste it again exactly as copied |
| Cookie list is empty | The setup has not been published live yet, or the declaration has no rows |
TagPipes monitors, configures and reports. It does not determine legal compliance and does not provide legal advice. Output is informational and reflects observed state at the time of observation. Confirm any regulatory interpretation with your counsel.