How to Exclude the Captain Compliance Consent Banner from Specific Pages
You may want to keep the Captain Compliance consent banner off specific pages of your website. Common examples include internal tools, confirmation pages, embedded experiences, and pages where a banner would be redundant.
How you exclude the banner depends on how Captain Compliance is deployed. This article covers Google Tag Manager (GTM) and direct (hard-coded) installations.
Exclude the banner in Google Tag Manager (recommended)
When Captain Compliance is deployed through GTM, add a trigger exception to the Captain Compliance CMP tag. The banner keeps loading everywhere else and is skipped on the pages you define.
Important: The exception must be a Consent Initialization trigger, the same type as the tag’s firing trigger. GTM applies an exception only when it fires on the same event as the firing trigger, so a Page View exception does not block a tag that fires on Consent Initialization.
Step 1: Create the exclusion trigger
In GTM, go to Triggers and click New.
Choose Consent Initialization as the trigger type.
Set This trigger fires on to Some Consent Initialization Events.
Add the conditions that identify the pages to exclude.
Give the trigger a descriptive name, such as
Captain Compliance CMP - Excluded Pages, and save it.
Common conditions include:
Page Path equals
/checkout/confirmationPage URL contains
/internalPage Path matches a regular expression
A custom variable that indicates an embedded or iframe context
Step 2: Add the exception to the tag
Open your Captain Compliance CMP tag.
Scroll to the Triggering section.
Click Add Exception and select the exclusion trigger.
Save the tag.
When the exception evaluates to true, the banner does not load on that page.
Exclude several pages
Conditions inside one trigger are combined with AND logic, so every condition must be true for the trigger to fire. To exclude several pages with OR logic, do one of the following:
Use a single regular expression condition, as in the example below.
Create several exclusion triggers and attach each one as an exception. GTM evaluates multiple exceptions with OR logic, so the tag does not fire if any one of them is true.
Example: set Page Path to matches RegEx with this pattern.
^/(internal|admin|preview|checkout/confirmation)The pattern matches any path that begins with /internal, /admin, /preview, or /checkout/confirmation.
Rules for GTM exclusions
Keep the Captain Compliance CMP tag firing on Consent Initialization for all other pages.
Do not remove the firing trigger to exclude pages. Always use exceptions.
Use only Consent Initialization triggers on this tag, for both firing and exceptions.
Use exclusions sparingly, to avoid unintended gaps in coverage.
Test the exclusion in GTM Preview before you publish. On an excluded page, the Captain Compliance CMP tag should not fire on the Consent Initialization event. See How to Test Your GTM Consent Setup.
Exclude the banner on direct (hard-coded) installations
If Captain Compliance is installed directly on the site, for example with a <script> tag in the HTML or a template, the exclusion must happen before the script loads. GTM triggers are not available, so the page-level conditions are enforced in code.
Conditional script loading
Include the Captain Compliance script only when your conditions are met. For example:
Skip the script on specific URL paths.
Exclude known templates or page types.
Check for query parameters or environment flags.
Server-side or template logic
Many platforms support conditional logic at the template or server level, such as:
CMS template conditions
Server-side routing checks
Page-type flags or layout rules
In these cases, omit the Captain Compliance script entirely from the excluded pages.
Before you exclude a page
Excluding the banner does not disable tracking on those pages.
In GTM, the Captain Compliance CMP tag is what sets consent defaults. On a page where it does not fire, other tags see consent as granted, so exclude or block non-essential tags on those pages yourself. See How to Gate GTM Tags with Native Consent Settings.
Prefer GTM exclusions where possible, because they are easier to audit and maintain.
