Placing ads on sites with CSP

If you want ads displayed on your site, embed the ad unit code inside the HTML code of your site pages. Sites that support the Content Security Policy will only execute this embed code under special circumstances. In particular, the browser needs to receive permission to process data in the HTTP header, which includes the permission to display ads, load images, and use styles.

Add the following code to the HTTP header:

  default-src 'none';
  connect-src 'self' blob: * *;
  frame-src * * *;
  img-src 'self' * * * data:;
  media-src * * * blob: data:;
  script-src 'unsafe-inline' 'unsafe-eval' * **;
  style-src 'unsafe-inline' 'unsafe-eval' *;
  font-src 'self' data:;

For img-src, we recommend adding an array of * subdomains. This will let you keep your settings unchanged in the future.

Contact support

Send an email

Write to chat