TermsFeed Privacy Consent (CMP) needs 3 allowances in a Content Security Policy (CSP): its host in script-src, its host in connect-src, and 'unsafe-inline' in style-src. A Content Security Policy is the list of sources a browser lets a page load, sent as a response header or a <meta> tag. A policy that misses an allowance stops the consent banner or leaves it unstyled, and a policy that misses a vendor host blocks that vendor after the visitor accepts.

Privacy Consent loads every file and sends every request to cdn.termsfeedtag.com over HTTPS. Read who runs that host in cdn.termsfeedtag.com.

Each allowance covers one kind of request or style, and none needs another host. No request redirects to another host, and Privacy Consent does not load a font or frame of its own.

Directive Value Covers Without it
script-src https://cdn.termsfeedtag.com The loaders under /plugins/pc/v1/ and the code files under /plugins-code/pc/v1/ The browser refuses the scripts, and no consent banner appears
connect-src https://cdn.termsfeedtag.com The 2 settings.json requests and the events.push requests sent at page load and at each answer, under /plugins-api/pc/v1/ and /plugins-api-w/pc/v1/ The settings never arrive, so no consent banner appears and no answer reaches the consent log
style-src 'unsafe-inline' The <style> elements Privacy Consent adds to <head>, your Custom CSS included, and the style attributes in its markup The consent banner, the Preferences Center, and the embed placeholders render without styling, and the hidden Save Selection button shows

The Your Privacy Choices icon adds a smaller need. The icon is a data: image with no request behind it, so a policy that limits images needs data: in img-src. It shows wherever the US opt-out parts apply, and without the allowance the link keeps its text and loses its icon.

This policy holds only the Privacy Consent allowances next to 'self'. Merge the directives into your existing policy rather than replacing it.

Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.termsfeedtag.com; connect-src 'self' https://cdn.termsfeedtag.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:

Keep nonces and hashes out of style-src. Browsers ignore 'unsafe-inline' in a directive that holds a nonce or a hash, and the Privacy Consent stylesheet carries neither.

Vendor tags inherit your Content Security Policy

Your policy applies to every vendor tag Privacy Consent runs, exactly as it applies to your own scripts. Privacy Consent adds each vendor tag to the page as a new element, so the browser checks it like any other element. A vendor tag whose host is missing fails after the visitor accepts, with a Refused to load line in the Console and no Privacy Consent code beside it.

Add each vendor host to the directive its requests use.

Vendor tag or replaceable tag Directive for the vendor host
JavaScript vendor tag with a src script, or termsfeed-privacy-consent-tag-script script-src
Requests a vendor script sends, such as analytics beacons connect-src, and img-src for pixel requests
Style vendor tag, or termsfeed-privacy-consent-tag-style style-src
Link vendor tag loading a stylesheet or a font file, or termsfeed-privacy-consent-tag-link style-src, and font-src for the fonts it loads
HTML vendor tag or termsfeed-privacy-consent-tag-iframe holding a frame frame-src
HTML vendor tag or termsfeed-privacy-consent-tag-img holding an image img-src

This policy extends the first one for Google Analytics 4 (GA4), the Meta Pixel, and a YouTube embed. Replace those hosts with the hosts your own vendors publish, such as the list in the Google tag Content Security Policy guide.

Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.termsfeedtag.com https://www.googletagmanager.com https://connect.facebook.net; connect-src 'self' https://cdn.termsfeedtag.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://www.facebook.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com https://www.facebook.com; frame-src https://www.youtube.com; style-src 'self' 'unsafe-inline'

Inline JavaScript in vendor tags

A vendor tag with inline JavaScript, such as the gtag('config', ...) lines of GA4, becomes an inline script on your page. A script-src without 'unsafe-inline' blocks it, while a vendor tag that only loads a src script passes on its host alone. Inline code in a termsfeed-privacy-consent-tag-script element follows the same rule.

You have 2 ways to allow inline vendor code. Add 'unsafe-inline' to script-src, which allows every inline script on the page, your own included. Or keep script-src strict and move the inline code of each vendor tag into a file on your own domain. The vendor tag then holds only a line such as <script src="/js/ga4-config.js"></script>, which 'self' allows.

Why nonces do not work for vendor tags

A nonce-based policy blocks inline vendor tags, because Privacy Consent does not add a nonce to the scripts it creates. A nonce is a random value your server puts in the policy and on each allowed script, and it changes with every response. Your vendor tags come from the TermsFeed app, with the same text for every visitor, so no vendor tag carries the nonce of the current response.

A nonce changes 2 more things in your policy. Browsers ignore 'unsafe-inline' in a script-src that holds a nonce, so that way of allowing inline code stops working. A policy that allows scripts by nonce alone blocks every file after plugin.js, because Privacy Consent adds those files with no nonce.

Keep https://cdn.termsfeedtag.com in script-src next to your nonce, so the Privacy Consent files load by host. 'strict-dynamic' lets those files run once plugin.js carries your nonce, but browsers then ignore every host in script-src. Inline vendor tags stay blocked in both setups, so move their code into files on your domain.

How to test the policy in report-only mode

Send the policy as Content-Security-Policy-Report-Only first, so the browser reports every blocked source without blocking it. Visitors keep a working consent banner and working vendors while you tune the policy. This header reports every violation to /csp-report on your own server, and your full policy replaces its directives.

Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' https://cdn.termsfeedtag.com; connect-src 'self' https://cdn.termsfeedtag.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:; report-uri /csp-report

Deploy the header, load your site in a private window, click I Agree, and open a page with every vendor. Each report and each Console line that starts with [Report Only] Refused to names a blocked source and its directive. Add those sources and repeat until no report arrives, then switch to the enforcing header.

How to verify your Content Security Policy

Deploy the enforcing policy and clear any page cache first, since a cached page keeps the earlier header. The check takes 6 steps in Chrome DevTools, before and after the first answer. A visit with no consent banner runs its vendor tags on load, so it skips step 4.

  1. Open your site in a private window, open Chrome DevTools, and select the Console tab.
  2. Reload the page and confirm that no line starts with Refused to.
  3. Select the Network tab and type termsfeedtag in the filter box. Every request shows status 200, or 201 for events.push, and none shows (blocked:csp).
  4. Click I Agree on the consent banner. A new events.push request appears with status 201.
  5. Return to the Console tab and confirm that no Refused to line appears.
  6. Type the host of each vendor in the Network filter box, such as google-analytics.com. Its requests appear with a success status.

Repeat the check each time you add a vendor, because a new vendor host fails silently on the page until you add it to the policy.