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'); 

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:

enter image description here

but in app, loads one:

enter image description here

how can make works?

you can try library made chrome apps , extensions. https://github.com/googlechrome/chrome-platform-analytics


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -