I have a TabActivity in android that adds 4 separate activities to a TabHost.
On the onCreate of the TabActivity I call:
tracker = GoogleAnalyticsTracker.getInstance();
tracker.start("MY UNIQUE GA CODE HERE", 10, getApplication());
And on the TabActivity onDestroy() I have
tracker.stop();
On the onResume of each activity added to the TabHost I have:
tracker = GoogleAnalyticsTracker.getInstance();
tracker.trackPageView("/ActivityTitle");
Is this the best way to do this, I have seen different methods but none consistant, eg adding the start method to each activity - but wouldn't this inflate the unique views?
Any help much appreciated Thanks in advance
Update
I have finally got some stats through and eveything seems to be working, I will reserve judgement on the time spent in app average but 'appears' to be correct. any input for best practice much appreciated. PS I get a warning in eclipse that the .start() and .stop() methods are depreciated, Googles documentation has not been updated yet so cant see a better way to do this, if you know please add. Thanks.