Com.google.analytics.tracking.android.easytracker

 

When you use EasyTracker, global configuration settings are managed using resources defined in XML. Create a file called analytics.xml in your project's res/values directory and add the following resources:

Your lint checker may warn you about the use of the figure dash ('-') in your tracking ID. You can suppress that warning by adding additional attributes to your <resources> tag:

See the analytics.xml parameters reference for the complete list of parameters you can use to configure your implementation. Depending on your applications requirements, you may wish to change the dispatch period to verify that you are properly sending hits. For example if you want to see real time data, you may want to set this to a low value such as 5s.

Com.google.analytics.tracking.android.easytracker

Just need to know the proper way to implement Google analytics to track when a user is on a fragment in real time this is what is do now

Tracking methods section suggests that you just need to call EasyTracker.getInstance().setContext(getActivity()); first, then you can use the tracker in "other classes".

Another approach for V3 (since onResume() is tied to the Activity and not the Fragment. This works well when the parent/child relationships are well-known.

When you use EasyTracker, global configuration settings are managed using resources defined in XML. Create a file called analytics.xml in your project's res/values directory and add the following resources:

Your lint checker may warn you about the use of the figure dash ('-') in your tracking ID. You can suppress that warning by adding additional attributes to your <resources> tag:

See the analytics.xml parameters reference for the complete list of parameters you can use to configure your implementation. Depending on your applications requirements, you may wish to change the dispatch period to verify that you are properly sending hits. For example if you want to see real time data, you may want to set this to a low value such as 5s.

APIs in V3 have been refactored to be more consistent across native and web platforms. All V2 users should note these changes:

It is recommended that EasyTracker v1.x users follow the v3 Getting Started Guide to begin using v3 with EasyTracker.

v1.x users who do not use EasyTracker should follow the V3 Getting Started Guide and consult the Advanced Configuration Developer Guide as needed.

Events are a useful way to collect data about a user's interaction with interactive components of your app, like button presses or the use of a particular item in a game.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License , and code samples are licensed under the Apache 2.0 License . For details, see our Site Policies . Java is a registered trademark of Oracle and/or its affiliates.

EasyTracker is a class designed to easy the burden of adding Google Analytics tracking code to your application. It runs in single thread.