Use one cookie banner on several hostnames and know where consent stops
Add each domain of your site to one TermsFeed Privacy Consent cookie banner on the Settings page, and paste the same snippet on every hostname. The list sits under "Additional domains". One consent banner then runs everywhere with the same vendors, appearance, company location, and consent log. A hostname is the part of a web address before the path, such as example.com, www.example.com, or shop.example.com.
Consent stays on the hostname where the visitor gave it. A visitor who answers on www.example.com sees the consent banner again on shop.example.com and on example.com, and answers again there.
How to add an additional domain
Adding a domain takes 5 steps and about 5 minutes, plus the time to install the snippet on the new site. You need access to the consent banner in the TermsFeed app and the list of hostnames your pages load from.
- Open your consent banner in the TermsFeed app and click "Settings" in the sidebar.
- Under "Additional domains", click "+ Add domain".
- Type the domain, such as
shop.example.com, or a full address, since the app removes the scheme, a leadingwww., and the path. - Click "Add". The app saves the domain at once and adds it to the list, where "Remove" takes it off again.
- Paste the same snippet into the
<head>of the pages on the new hostname, then run the checks in How to verify the consent banner on each domain. Copy the snippet from Install the Script.
The hint under "Additional domains" tells you how to cover subdomains on your account. It reads either "Add *.example.com to load the consent banner on every subdomain of example.com." or "Add each subdomain on its own." A wildcard counts as 1 domain.
An account has a limit on the additional domains of each consent banner, and the main domain does not count toward it. At the limit, adding fails with "Domain limit reached".
You do not add a development hostname. The consent banner loads on localhost, *.localhost, *.local, 127.0.*.*, and *.example.com without one. The app refuses such a domain with a message that starts "You don't need to add". A domain with a port fails with "That domain doesn't look right. Enter it like shop.example.com or *.example.com."
What the domain list does
Privacy Consent loads your consent banner on the domains you add: the main website domain and the additional domains. List every hostname that carries the snippet. The Analytics page counts the banner loads of each listed domain and every subdomain of it. Apart from development hostnames, it does not show a hostname you did not list. Check for a snippet running somewhere you did not plan in the domain column of the consent log download, with Diagnose Setup From the Consent Log.
The app stores www.example.com as example.com, so the 2 forms take one line in the list. They stay 2 hostnames in the browser, each with its own answer.
When the app refuses a domain
Adding a domain this consent banner already lists fails with "shop.example.com is already on this consent banner."
On the free plan, the app refuses a domain where a free consent banner of another customer used up its banner loads. The message reads "A consent banner on the free plan used up its banner loads on this domain. Choose a higher plan to use the domain here."
Consent does not carry across hostnames
A choice made on one hostname does not apply on any other hostname, even when one consent banner serves both. Privacy Consent stores the answer in localStorage, and browsers keep it separately for each origin, meaning each combination of protocol, hostname, and port. Each of these pairs keeps 2 separate answers.
- The
wwwform and the bare form.www.example.comandexample.comask separately. - Subdomains.
shop.example.comandblog.example.comask separately. - Separate domains.
example.comandexample.co.ukask separately. - A change of protocol.
http://example.comandhttps://example.comask separately.
Each hostname stores its own consent identifier, so the consent log shows one person who answered on 2 hostnames as 2 visitors. Privacy Consent has no setting that shares an answer between hostnames. Read what Privacy Consent ignores and what your own code does with Cross-Subdomain Consent.
Use one consent banner for each website
Use one consent banner for one website: its main domain, plus any additional domains that share its vendors, policies, and company details. A website that needs its own vendors, policies, or company details needs its own consent banner. Every setting applies to every hostname of the consent banner.
| Setting | With one consent banner | With a consent banner per site |
|---|---|---|
| Vendors and vendor tags | Every vendor runs on every hostname, including a pixel only one site needs | Each site runs only its own vendors |
| Cookies Policy and Privacy Policy links | One URL each for all sites | A URL per site |
| Website name and domain in the header of the consent banner | One name for all sites | A name per site |
| Company country and state | One company for all sites, so one result for the consent logic | A company per site |
| Consent banner type, colors, and "Default language" | The same on every site | Chosen per site |
| Consent log | One log, split by the domain column of the CSV export |
One log per site |
A shop and a blog of the same company with the same vendors fit on one consent banner. Separate companies, separate policies, or different vendors each call for separate consent banners.
How to verify the consent banner on each domain
Run this check on every hostname of the consent banner, because each hostname loads its own settings and keeps its own answers. It takes about 2 minutes per hostname. It assumes a visitor who gets the consent banner, such as a new consent banner on "Strict".
- Open the first hostname in a new private window with Chrome DevTools open, select the Network tab, and filter for
settings.json. - Confirm 2 requests with status 200, both with the hostname in their path, and
"serviceable": truein the response of the request whose path contains/plugins-api-w/. - Click I Agree, select the Application tab, open Local storage, and confirm that the key
termsfeed_privacy_consent_stateunder that hostname holdsconsentState. - Open the next hostname in the same window. The consent banner appears again, and the key under that hostname holds only
user_tokenuntil you answer. - Repeat the steps for every hostname on the list.
Each hostname now runs the consent banner on its own answers. Check the consent log a day later: the domain column of the CSV export lists each hostname that sent events. Download it with Export to CSV.