Placing ads on websites with CSP

If you want ads displayed on your site, embed the ad unit code inside the HTML code of your site pages. Websites 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 a lot of * subdomains. This will let you keep your settings unchanged in the future.