Ik probeer Google analytics draaiend te krijgen i.c.m. Client Security Policy, Analytics zegt alleen nog steeds dat de tracking code niet geïnstalleerd is.
Wat ik heb geprobeerd:
- 'script-nonce' directive goed instellen, en nonce attribuut aan analytics script tag toegevoegd
- Juiste google CDN's toegevoegd
Voorbeeld headers:
GA-code voor de </head> tag (minified):
Wat ik heb geprobeerd:
- 'script-nonce' directive goed instellen, en nonce attribuut aan analytics script tag toegevoegd
- Juiste google CDN's toegevoegd
Voorbeeld headers:
code:
1
2
| X-Content-Security-Policy:default-src 'self' static.test.net; img-src static.test.net 'self' data: www.google-analytics.com *; font-src static.vgst.net; style-src 'self' 'unsafe-inline' static.vgst.net google.com www.google.com ajax.googleapis.com; script-src 'unsafe-eval' static.test.net *.googleapis.com google.com *.google.com *.google-analytics.com; options eval-script; script-nonce 50fd2217155eb X-WebKit-CSP:default-src 'self' static.test.net; img-src static.test.net 'self' data: www.google-analytics.com *; font-src static.vgst.net; style-src 'self' 'unsafe-inline' static.test.net google.com www.google.com ajax.googleapis.com; script-src 'unsafe-inline' 'unsafe-eval' static.test.net *.googleapis.com google.com *.google.com *.google-analytics.com; options eval-script; script-nonce 50fd2217155eb |
GA-code voor de </head> tag (minified):
HTML:
1
| <script type="text/javascript" nonce="50fd2217155eb">var _gaq=_gaq || [];_gaq.push(['_setAccount', 'UA-37811875-1']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol ? 'https://ssl' : 'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga, s);})();</script>> |
[ Voor 3% gewijzigd door bindsa op 21-01-2013 12:24 ]