Skip to content

EARN UP TO 50% COMMISSION WITH OUR RESELLER ACCOUNTS + REGULAR PASSIVE INCOME SIGN UP TODAY

Install CookieScan

Allow CookieScan in your Content Security Policy

Add CookieScan's two addresses to your website's Content Security Policy, so your cookie banner loads, looks right and saves choices.

Updated 3 min read

Applies to:
  • Cookie banner

https://cookiescan.com/help/allow-cookiescan-in-your-csp/ Β· Updated 12 October 2026

On this page

Before you start

A Content Security Policy (CSP) is a header that tells browsers which addresses your website may load from. You only need this article if your website sends one. Signs that your policy blocks CookieScan:

  • the banner doesn't appear, or appears without its styles
  • the banner's buttons don't respond
  • your browser's console shows messages about a Content Security Policy that name cookiescan.com

You need access to wherever your website sets its policy, such as your web server, hosting settings or a security plugin.

Add CookieScan's addresses

Your cookie banner loads from two addresses: https://banner.cookiescan.com and https://cdn.cookiescan.com. Add them to these directives, alongside the sources you already allow.

DirectiveAddWhat it allows
script-srchttps://banner.cookiescan.com https://cdn.cookiescan.comThe CookieScan script and the banner's own script
style-srchttps://cdn.cookiescan.comThe banner's stylesheet and font styles
font-srchttps://cdn.cookiescan.comThe banner's font
img-srchttps://cdn.cookiescan.comThe banner's images, such as the CookieScan logo
connect-srchttps://banner.cookiescan.com https://cdn.cookiescan.comLoading the banner's content and saving each visitor's choice
style-src-attr'unsafe-inline'The inline style attributes that keep parts of the banner hidden

For example, a policy that allows only your own website and CookieScan looks like this:

Text
script-src 'self' https://banner.cookiescan.com https://cdn.cookiescan.com;
style-src 'self' https://cdn.cookiescan.com;
style-src-attr 'unsafe-inline';
font-src 'self' https://cdn.cookiescan.com;
img-src 'self' https://cdn.cookiescan.com;
connect-src 'self' https://banner.cookiescan.com https://cdn.cookiescan.com

Inline styles

The banner applies its colours without an inline style element, so style-src doesn't need 'unsafe-inline' for them. In older browsers, such as Safari before version 16.4, the banner falls back to an inline style element. Your policy blocks that unless it allows 'unsafe-inline', and the banner then shows its default colours.

The banner also keeps some of its parts hidden with inline style attributes, such as its preferences panel. Allow them with style-src-attr 'unsafe-inline'. Without it, the preferences panel can show as soon as the page loads.

Nonces

If your policy allows scripts by nonce, add your nonce to the CookieScan script tag. If it also uses 'strict-dynamic', the banner's own script is then allowed too, because the CookieScan script loads it.

Check it worked

Open your website in a private browser window, with your browser's console open. Your cookie banner appears with its colours and font, and its buttons work. The console shows no Content Security Policy messages that name cookiescan.com. Make a choice, then check that the Dashboard shows Receiving consents.

Next steps

Was this article helpful?

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks, your comment has been sent.

Sorry, we couldn't record your feedback. Please try again later.

Still stuck?

Our support team can help with anything these guides don't cover. Tell us your CookieScan ID and the page address so we can look straight away.

Back to Install CookieScan