Example of using Google Analytics with fragments?


I want to use google analytics within a fragment for tracking screen views. I don't understand where we should allocate a Tracker instance. The doc on manual screen tracking leaves us with this example:

 * Within an Activity or Fragment
public void onStart() {
    ... // Your other onStart() code.
    myTracker.sendView("Home Screen"); // Where myTracker is an instance of Tracker.


Where is "myTracker" defined? What is its lifecycle? I'm looking for a skeleton Fragment that shows the lifecycle of the "myTracker" variable.


myTracker is instance of Tracker which you can get from EasyTracker.getTracker()

This is URL to concrete jar https://code.google.com/p/analytics-api-samples/downloads/list