Situation:
I want to track events from my chrome app that has the following URL
chrome-extension://APP_ID.
In Google Analytics webpage, the only supported protocols are http and https
I just entered a random URL for the Website URL for now. I also set my manifest properly:
"permissions": ["webview", "browser", "http://www.youtube.com/*",
"https://www.youtube.com/*", "https://fonts.googleapis.com/*",
"https://www.google-analytics.com/*", "https://ssl.google-analytics.com/", "storage", "notifications
],
"sandbox": {
"pages": ["sandbox/sandbox.html"]
},
Then, from my app I do the following when the app starts inside a sandbox:
(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','https://ssl.google-analytics.com/analytics.js','ga');
ga('create', 'UA-TRACKING-ID', 'auto');
ga('set', 'checkProtocolTask', null); // Removes failing
ga('send', 'pageview');
Problem:
The analytics page doesn't show any events so I am assuming setting the default url properly might actually matter. What should I do to track events from my Chrome app?
Update:
I see that the following request fires.
http://www.google-analytics.com/collect?v=1&_v=j41&a=1768111489&t=pageview&_s=2&dl=chrome-extension%3A%2F%extension_ID%2Fsandbox%2Fsandbox.html&ul=ko&de=EUC-KR&sd=24-bit&sr=1440x900&vp=300x200&je=0&fl=21.0%20r0&_u=SAEAAEABI~&jid=&cid=2006929393.1458033861&tid=UA-75139981-5&z=437206753' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8,ko;q=0.6' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36' -H 'Accept: image/webp,image/,/*;q=0.8' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive
Does this mean I am sending Google Analytics requests correctly? Should I wait a couple of days to see the first update?
