ANE-Google-Analytics is a native extension to use Google Analytics on the iOS and Android platforms. Differently from other Google Analytics wrappers, this extension is not Javascript based, so it works with AIR apps. The extension follow closely the original Analytics SDK methods and functionalities, so it should be easy to use and understand.
Among other features, the extension allows the tracking of page views and events. All tracking is performed within the scope of a session, so the developer must explicitly start and stop the session. All tracking data must be sent while the session is active.
Sample
import eu.alebianco.air.extensions.analytics.GATracker; if (GATracker.isSupported()) { var tracker:GATracker = GATracker.getInstance(); tracker.startNewSession("UA-00000000-0", interval); tracker.trackPageView("/custom/view/url"); }
RT @as3gamegears: New: ANE-Google-Analytics (native extension to use Google Analytics on Android and iOS) http://t.co/8bsck0jb1P #as3 #flas…
Great! thanks a lot. This will definitely be used a lot.
You’re welcome! I was in need for something like that too
Hi, ANE-Google-Analytics is great and easy to be used, but have a question. the code above shows interval that is the time of session, wondering what will be happened to tracker object after time out of the session. do we need to create another instance of tracker in every time out? I ‘ve used 20 as interval and about first 20sec, my app crashes without any warns, but if i set huge numbers or -1 and it dosen’t crash
Hi! As far as I could tell, the “interval” param is used to automatically send your tracking data to Google servers. If your app is crashing, that’s probably because it’s unable to send the data (maybe internet permission or something like that?).
If you use -1 for “interval”, you have to manually send the tracking data using
dispatch()
. Try to contact the ANE author to get more info or report a bug.the extension simple not work to me
and i can’t understand why
i use AIR SDK 3.6
You can open an issue at the github repository or you can ask @alebianco for help.
The code above doesnt work and there is no GATracker
Hi! The code samples I provide are usually not functional, since they are there just to give the developer a glimpse of the tool API. Please check the tool doc/website for more infornation (including a working code sample).