Google Analytics不会从我的应用中获取数据

时间:2014-03-18 13:04:11

标签: java android xml google-analytics

我将使用Google Analytic来获取Google Play提供的更多数据。我所做的就像教程说的那样: Google Guides

@Override
public void onStart() {
    super.onStart();
    // The rest of your onStart() code.
    EasyTracker.getInstance(this).activityStart(this);  // Add this method.

}

@Override
public void onStop() {
    super.onStop();
    // The rest of your onStop() code.
    EasyTracker.getInstance(this).activityStop(this);  // Add this method.
}

analytics.xml id替换为###

<?xml version="1.0" encoding="utf-8" ?>
<resources>
    <!--Replace placeholder ID with your tracking ID-->
    <string name="ga_trackingId">UA-###-1</string>
    <!--Enable automatic activity tracking-->
    <bool name="ga_autoActivityTracking">true</bool>
    <!--Enable automatic exception tracking-->
    <bool name="ga_reportUncaughtExceptions">true</bool>
    <integer name="ga_dispatchPeriod">15</integer>
</resources>

清单:

<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

1 个答案:

答案 0 :(得分:0)

使用您的应用的analytics.xml更新您的tracking ID,如下所示,

    <string name="ga_trackingId">UA-48673260-1</string>