In an example provided by Google (http://code.google.com/p/analytics-api-samples/), it doesn’t show how to customize page tracking. For example, where in the code should I call something like:
Tracker.getInstance(getApplicationContext()).trackPageView("/MyActivity/"+myVariable);
Does anyone has experience on using this library? I also couldn’t find its documentation.
All you need to do is to make sure your activities inherit from
TrackedActivity, and they will be automatically tracked (considering you also enabledga_auto_activity_tracking).If you want to get the tracker object—to record events, for instance—just call
EasyTracker.getTracker().Edit: After a small discussion in the comments with Georgy Gobozov, I should add that you should not use EasyTracker before your
onStart()method, where you callsuper.onStart(). It’s on TrackedActivity’sonStart()method that it callstrackActivityStart(), which starts a new session.