• How it works
  • Partners
  • Blog
  • Docs
  • Sign up
  • Client Area
Web Monetization Blog > Optimization > Fixing SSL issues with ads by implementing a Content Security Policy (CSP)

Fixing SSL issues with ads by implementing a Content Security Policy (CSP)

Rarely there are upstream ads being served that contain tracking pixels and other assets requested over http instead of https. Without a Content Security Policy on your website, these assets will load and the user will see a warning that their connection is insecure. Since this warning is pretty alarming to the average user, we highly recommend setting up a CSP.

Basic implementation

The simplest way to get a CSP rule on your website that will prevent these SSL errors is to place the following meta tag in the <head> of your pages.

<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content" />

Advanced implementation

More advanced users can implement CSP rules server side by writing a response header. The process of doing this varies service to service, but we’ve outlined some popular ones below;

  • AWS/CloudFront
  • Cloudflare
  • nginx
    • Within server{}
      • add_header Content-Security-Policy "block-all-mixed-content";
  • Apache
    • Within .htaccess or VirtualHost
      • Header set Content-Security-Policy "block-all-mixed-content"

Categories

  • Compliance
  • Editorial
  • Metrics
  • News
  • Optimization
  • Press Release
  • Publisher Newsletter
  • Seasonal
  • Tips & Information
  • Viewability

Recent Posts

  • News Round-up: AI Job Concerns, Memorable Moments, and Social Media Advertising March 9, 2023
  • News Round-up: AI Bias, Virginia’s Data Protection Law, and Emotions in Ads March 1, 2023
  • News Round-up: Data Clean Rooms, Chatbot Ads, and Google’s Antitrust Lawsuit February 21, 2023
  • News Round-up: Green Supply Path, AI, & Walled Gardens February 14, 2023
  • Streamlining Data Protection with the Global Privacy Platform February 3, 2023
© GG Software, LP
Privacy Policy | Terms of Use | Contact us