Content Security Policy (CSP) is een web-beveiliging bedoeld om hackaanvallen te voorkomen door alleen geautoriseerde applicaties toe staan om met de (web)-server te ‘praten’.
Als de server gebruik maakt van een Content Security Policy (CSP) is het van belang dat Google Tag Manager en/of Google Analytics daarin meegenomen wordt, anders krijg je onderstaande foutmelding in de console te zien:
Krijg je deze foutmelding? Voeg dan onderstaande directives toe aan de CSP:
Google Tag Manager & Google Analytics (inclusief Google Signals)
script-src: https://*.googletagmanager.com
img-src: https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com
https://*.g.doubleclick.net https://*.google.com https://*.google.<TLD>
connect-src: https://*.google-analytics.com https://*.analytics.google.com
https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com https://*.google.<TLD>Google Analytics (Universal Analytics)
script-src: https://www.google-analytics.com https://ssl.google-analytics.com
img-src: https://www.google-analytics.com
connect-src: https://www.google-analytics.com
De CSP zijn ingesteld in de HTML headers, het .htaccess bestand of webserver instellingen.
Hulp nodig met je analytics vraagstukken?
Neem vrijblijvend contact met ons op. Met de nodige ervaring op het gebied van analytics komen we zeker tot een oplossing!