How to Deploy Multiple Consent Banners from One GTM Container
Captain Compliance banners are issued per domain, each with its own access token. When one GTM container serves several domains, each domain needs its own Captain Compliance tag, and each tag must fire only on its domain. This article shows how to set that up. If each domain has its own container, you don’t need this setup.
How it fits together
One Captain Compliance CMP tag per domain, each with that domain’s access token.
One Consent Initialization trigger per domain, limited to that domain’s hostname.
One shared
CaptainGPCSignalDetectedvariable; it isn’t domain-specific.Each tag references only its own domain’s trigger, so exactly one banner loads on any page.
Step 1: Create a trigger per domain
For each domain:
Go to Triggers, click New, and choose Consent Initialization.
Set This trigger fires on to Some Pages.
Add the condition Page Hostname matches RegEx with a pattern for the domain and its subdomains, for example:
^(?:.*\.)?example\.com$Name it after the domain, for example
Consent Initialization - example.com, and save.
If a domain shouldn’t include its subdomains, use Page Hostname equals with the exact host instead. For a group of hostnames, list them in the regex: ^(?:www\.|staging\.)example\.com$.
Step 2: Create a tag per domain
For each domain:
Go to Tags, click New, and choose Captain Compliance CMP.
Enter the access token for that domain. Configure the Google Consent Mode settings as in the template install article; the GPC signal variable is the same
{{CaptainGPCSignalDetected}}for every tag.Under Triggering, select that domain’s Consent Initialization trigger and nothing else.
Name it after the domain, for example
Captain Compliance CMP - example.com, and save.
Rules that keep this working
Only Consent Initialization triggers on these tags, both for firing and for exceptions. Don’t use the built-in Consent Initialization - All Pages with an exception of another trigger type to carve out a domain; GTM may accept it in the editor, but the tag is then invalid for container import and the banner can fire out of order. Use the hostname condition on the trigger itself.
One tag per domain. If two tags match the same hostname, two banners load.
Nothing else on these triggers. Google tags and other tags belong on Initialization or later, where they see the defaults the CMP sets.
Environment-specific triggers elsewhere in the container
Containers that serve several domains usually have other triggers filtered by hostname too, such as a production page view and a staging page view. When you move early-firing tags onto CC - Consent Ready, keep those conditions by making one copy of the Consent Ready trigger per original trigger, named CC - Consent Ready - followed by the original’s name. The CC - Consent Ready article covers the steps.
Verify
In Preview, load a page on each domain. On every one, Tag Assistant should show exactly one Captain Compliance tag fired on the Consent Initialization event, and the banner on the page should be that domain’s. Check a subdomain and the bare domain if your regex covers both.

