Can Content Security Policy be made compatible with Google Analytics and AdSense?

后端 未结 5 767
执念已碎
执念已碎 2020-12-15 09:47

Does anyone know how to get CSP, even with the default-src wildcard, to work so a modern Analytics script sends website per-page data (not just home page data) to the site o

5条回答
  •  难免孤独
    2020-12-15 10:06

    Or log all error with report-uri for add sources to your CSP.

    JSON will POST to that URL (https://example.com/csp/log.php).

    Content-Security-Policy: default-src 'self';
    report-uri: https://example.com/csp/log.php;
    

提交回复
热议问题