google chrome - How to make analytics works in manifest 2.0 -
i know how make works because paste code in app doesn't work.
the code generated analytics this:
(function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-xxxxxx-x', 'auto'); ga('send', 'pageview');
so, tried config this:
"content_security_policy": "script-src 'self' http://www.google-analytics.com; object-src 'self'"
but doesn't work because "content_security_polict" accept https , not http.
- i tried config path in "permission" too:
{ ... "permissions": ["https://www.google-analytics.com/analytics.js"] ... }
but doesn't workt too.
- i tried set https fixed in analytics code, doesn't work too.
in normal web page, loads 2 files:
but in app, loads one:
how can make works?
you can try library made chrome apps , extensions. https://github.com/googlechrome/chrome-platform-analytics
Comments
Post a Comment