I'm building a mobile HTML5 app that will be fully functional both in online and offline modes. I was wondering if anyone knew whether GA would track interactions when the app is offline? I've read that GA does seem to continue tracking for Android apps, syncing the data once it's back on开发者_开发知识库line, but I haven't seen any documentation that specifies whether it also can do so for HTML5 apps.
If GA doesn't track this, does anyone know of any other analytics packages that could track offline interactions? Thanks!
No, this functionality is not supported, since Google Analytics in the browser sends all of its requests at call-time; those requests are for an external asset that is not reachable without being online.
The Android functionality is unique to the Google Analytics Android (and iOS) SDK(s); since they can batch their requests and store them in the app, they're able to queue calls for the app to store to send when internet access is restored.
There is a potential solution: You could log requests internally using some of the Urchin tracking methods; you could set _setLocalGifPath
and _setLocalRemoteServerMode()
; if you could figure out how to get your app to store those request query strings locally, you could have the requests batch out to Google Analytics when GA is restored by iterating through the requests, stripping the local path, and creating image requests for the successive query strings by appending those values to http:/google-analytics.com/__utm.gif
. (This is all theory; I've never implemented it.)
精彩评论