Breaking News
Home / Android / Android Snippets / How do you configure Google Analytics v2 lib in Android?

How do you configure Google Analytics v2 lib in Android?

Answer

Create an xml file in the res/values directory called as analytics.xml

<?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-41303275-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>

<!>

[pb_builder]

Check Also

How to check if an Android device can connect to Internet?

The following code snippet shows how to check if an Android device can connect to …

Advertisment ad adsense adlogger