Google Analytics library is used to track application page views and other custom events. Simply create an XML file in the res/values directory called as analytics.xml
The following options can be configured:
- Define your tracking Id, the analytics with recorded under that account.
- Whether automatic tracking should be enabled.
- Whether to enable automatic exception tracking.
- Whether GA should run in debug mode. This can help in debugging if needed and should be set to false before publishing the app to the Play Store.
<?xml version=”1.0″ encoding=”utf-8″ ?> <resources xmlns:tools=”http://schemas.android.com/tools” tools:ignore=”TypographyDashes”> <!–Replace placeholder ID with your tracking ID–> <string name=”ga_trackingId”>UA-14132325-1</string> <!–Enable automatic activity tracking–> <bool name=”ga_autoActivityTracking”>true</bool> <!–Enable automatic exception tracking–> <bool name=”ga_reportUncaughtExceptions”>true</bool> <bool name=”ga_debug”>false</bool> </resources>