[英]Integrating Google Analytics in Android?
我正在嘗試將Google Analytics(分析)集成到我的應用中,但沒有向我發送報告或任何其他內容。 我跟着這個從谷歌指南,我粘貼.jar文件在我的libs文件夾,我設置了構建路徑,我所做的一切導游告訴我,但我什么也沒得到。 我沒有收到任何錯誤,但是當我在模擬器上運行它時,我沒有得到任何報告,並且日志貓也沒有顯示任何內容。 難道我做錯了什么? 謝謝!!
我的主要活動班:
public class StartingPoint extends Activity {
public class myTrackedActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onStart() {
super.onStart();
// The rest of your onStart() code.
EasyTracker.getInstance().activityStart(this); // Add this method.
}
@Override
public void onStop() {
super.onStop();
// The rest of your onStop() code.
EasyTracker.getInstance().activityStop(this); // Add this method.
}
}
public final static String EXTRA_MESSAGE = "com.primarycode.punnyjokes.MESSAGE";
//public static int iteration = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_starting_point);
}
我的價值觀中的ANALYTICS.XML
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<!--Replace placeholder ID with your tracking ID-->
<string name="ga_trackingId">UA-43160348-1</string>
<!--Enable automatic activity tracking-->
<bool name="ga_autoActivityTracking">true</bool>
<bool name="ga_dryRun">false</bool>
<!--Enable automatic exception tracking-->
<bool name="ga_reportUncaughtExceptions">true</bool>
</resources>
您忘記了啟動EasyTracker。 在項目的Application類的onCreate上執行此操作。
onCreate(){
super.onCreate();
EasyTracker.getInstance().setContext(this);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.