How to Exclude the Captain Compliance Consent Banner from Specific Pages

Edited

In some cases, you may want to prevent the Captain Compliance consent banner from appearing on specific pages of your website. Common examples include internal tools, confirmation pages, embedded experiences, or pages where a banner would be inappropriate or redundant.

How you exclude the banner depends on how Captain Compliance is deployed. This article explains how to do this both when using Google Tag Manager (GTM) and when using a direct (hard-coded) installation.

Excluding the Banner When Using Google Tag Manager (Recommended)

When Captain Compliance is deployed through GTM, the preferred way to exclude the banner from specific pages is by using a trigger exception on the Captain Compliance CMP tag.

This approach allows the banner to load globally while preventing it from firing on defined pages or conditions.

Step-by-Step: Add an Exclusion Trigger

Step-by-Step: Add an Exclusion Trigger

  1. Open your Captain Compliance CMP (Strictly Necessary) tag in GTM

  2. Scroll to the Triggering section

  3. Under Firing Triggers, click Add Exception

  4. Create a trigger that defines the pages where the banner should be excluded

To create the exclusion trigger:

  • Click New

  • Name the trigger something descriptive, such as:
    Captain Compliance CMP – Excluded Pages

  • Choose a trigger type (most commonly Page View)

  • Select Some Page Views

  • Define the conditions that identify the pages to exclude

Common exclusion patterns include:

  • Page URL contains /internal

  • Page Path equals /checkout/confirmation

  • Page URL matches a specific regular expression

  • Custom variables indicating embedded or iframe contexts

Once the exception trigger evaluates to true, the Captain Compliance banner will not load on those pages.

Using Multiple Pages in an Exclusion Trigger

In GTM, trigger conditions are evaluated using AND logic by default. This means that multiple conditions within a single trigger must all be true for the trigger to fire.

To exclude multiple pages using OR logic, use one of the following approaches:

  • Use a regular expression in a single condition (for example, matching multiple paths in one rule)

    • Example: This regex will evaluate to true for any of the following paths:

      • /internal

      • /admin

      • /preview

      • /checkout/confirmation

      ^/(internal|admin|preview|checkout/confirmation)
  • Create multiple exclusion triggers and attach all of them as exceptions to the Captain Compliance CMP tag

When multiple exception triggers are attached to a tag, GTM evaluates them using OR logic. If any exception trigger evaluates to true, the tag will not fire.

Important Notes for GTM Deployments

  • The Captain Compliance CMP tag should continue to fire on Consent Initialization for all other pages

  • Do not remove the primary firing trigger to exclude pages; always use exceptions

  • Exclusions should be used sparingly and deliberately to avoid unintended gaps in coverage

Using GTM exceptions keeps banner logic centralized, auditable, and easy to adjust over time.

Excluding the Banner for Direct (Hard-Coded) Installations

If Captain Compliance is installed directly on the site (for example, via a <script> tag in the HTML or template), exclusions must be handled before the script loads.

In this model, GTM trigger logic is not available, so page-level conditions must be enforced in code.

Conditional Script Loading

Only include the Captain Compliance script when specific conditions are met.

Examples:

  • Do not load 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, the Captain Compliance script should be omitted entirely from excluded pages.

Final Notes

  • Excluding the banner does not automatically disable tracking on those pages

  • Any non-essential tags on excluded pages must still be governed by consent logic elsewhere, or intentionally excluded

  • When possible, GTM-based exclusions are preferred because they are easier to audit and maintain