谷歌分析不显示任何数据

时间:2013-03-15 10:55:58

标签: android google-analytics

我正在检查一个示例谷歌分析Android应用程序,但我的谷歌分析帐户中没有显示数据。这是我的代码:

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); 
  }
}

这可能是什么原因?是否需要一些时间来显示数据?

1 个答案:

答案 0 :(得分:1)

您不会看到实时更新。看看this。您会发现谷歌分析,就像您的Google Play开发者控制台每天大约每天更新一次一样。