Once you have a tracking session up and running, tracking events is relatively straightforward. Here we configure the tracker to send data to the Google Analytics servers every 30 seconds: tracker.startNewSession("UA-12345678-9", 30, this) Step 3: Tracking Application Activity – An Overview Start the tracker with a valid Google Analytics user account token. Get an instance of the tracker: GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance() To start a tracking session, you'll need to import the tracker: import .analytics.GoogleAnalyticsTracker Typically, you'll start your tracker somewhere like your Activity class onCreate() or onResume(). All tracking must occur during this session. In order to collect statistics, your application must be running a tracking session. Note: This tutorial is based upon the latest version of the Google Analytics for Android SDK Release 2 (in the Android SDK Manager), with Version 1.4.2 listed in the ReadMe.txt file and on the website download link. This tutorial assumes you have an existing Android project in Eclipse to work from, that you have properly installed the Google Analytics SDK for Android, as described in "Android App Publication: Enabling Google Analytics to Gather App Statistics", and that you have signed up for a Google Analytics account. Therefore, you’ll want to start with an application that is already pretty complete, in order to add statistics gathering in the appropriate code locations. There’s no point in hooking up Google Analytics unless you’ve already designed an Android application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |