我正在检查一个示例 google 分析 Android 应用程序,但我的 google 分析帐户中没有显示任何数据。这是我的代码:
public class ClickTrackerActivity extends Activity {
GoogleAnalyticsTracker tracker;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Start your statistics tracking
tracker = GoogleAnalyticsTracker.getInstance();
tracker.startNewSession("UA-39298495-1", 30, this);
setContentView(R.layout.main);
tracker.trackPageView("/ClickTracker-Main-Screen");
}
@Override
protected void onDestroy() {
super.onDestroy();
tracker.stopSession();
}
public void onClickHighButton(View v) {
// High button clicked.
Toast.makeText(ClickTrackerActivity.this, "Chose the High Road", Toast.LENGTH_SHORT).show();
tracker.trackEvent("Clicks", "Button", "High Road", 0);
tracker.dispatch();
}
public void onClickLowButton(View v) {
// Low button clicked.
Toast.makeText(ClickTrackerActivity.this, "Chose the Low Road", Toast.LENGTH_SHORT).show();
tracker.trackEvent("Clicks", "Button", "Low Road", 0);
}
}
这可能是什么原因?显示数据需要一些时间吗?