Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between EasyTracker and the regular Tracker?

The Google documentation for Google Analytics version 3 is very confusing regarding the differences between EasyTracker and the regular Tracker class, and I'm really not sure which one I should be using. On this page, they talk about setting up the EasyTracker, using the analytics.xml file to set up your ID, but then on the next page they talk about setting up a regular tracker and passing it your ID:

// Initialize a tracker using a Google Analytics property ID.
GoogleAnalytics.getInstance(this).getTracker("UA-XXXX-Y")

What are the differences between these two trackers? Does one have more features than the other? I gather that the EasyTracker is simpler to set up if you just want Activity tracking, but if I want to use all of the features available to me in Google Analytics, can I still do all that with the EasyTracker, or do I need to switch to the regular Tracker?

like image 628
Carl Anderson Avatar asked Nov 13 '13 18:11

Carl Anderson


1 Answers

I ended up going straight to the Google Analytics Developer Forum to get the answer:

EasyTracker is a subclass of Tracker that may be conveniently initialized via xml resource values, rather than programmatically.

EasyTracker also provides automatic session management, by keeping track of whether your app is in the foreground or background via the EasyTracker.getInstance(context).activityStart() and activityStop() methods.

If you just use Tracker, you need to programmatically initialize it with all of your desired config options, and you don't get the automatic session management that takes into consideration when your app is in the foreground or background -- instead, the lengths of your sessions will be determined solely by the Session Timeout Period you've configured in the GA interface for your property.

Subsequent discussion there didn't seem to turn up any situation where you wouldn't want to use an EasyTracker if you're just starting out.

Another important note - there are full fledged javadocs for the code that are only available as part of the code package, and not available anywhere on their public website.

like image 81
Carl Anderson Avatar answered Nov 15 '22 09:11

Carl Anderson