Skip to main content
All CollectionsDigging deeper
Content Security Policy (CSP) instructions
Content Security Policy (CSP) instructions

Directives to add when using Consent Studio

J
Written by Juul van Schayik
Updated this week

Using the Consent Studio (cookie) consent banner on a website with a Content Security Policy

Javascript

Add the following source to your script-src directive. Note: replace the [your domain here] with your site's domain.

https://consent.studio/[your domain here]/banner.js

When you have integrations enabled, you also need to add the following source to your CSP script-src directive. Note: replace the [your domain here] with your site's domain.

https://consent.studio/api/v1/public/site/[your domain here]/integrations.js

Styling

Our cookie banner uses inline CSS in order to modify the styling of the banner. This inline CSS is added to the DOM at runtime of banner.js.

Thus, you have the following options:

  • Using unsafe-inline for CSS (The use of 'unsafe-inline' is discouraged. You should carefully consider the security ramifications of adding this directive to the CSP before using this approach.)

  • Copying the CSS to your own environment

Did this answer your question?