2013-08-05 54 views
0

按照Google網站上的教程,我有以下問題。我的谷歌分析是否爲我的iOS應用程序正確設置?

在我的應用我補充一點:

appdelegate.m

[GAI sharedInstance].trackUncaughtExceptions = YES; 
    // Optional: set Google Analytics dispatch interval to e.g. 20 seconds. 
    [GAI sharedInstance].dispatchInterval = 20; 
    // Optional: set debug to YES for extra debugging information. 
    [GAI sharedInstance].debug = YES; 
    // Create tracker instance. 
    id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXX"]; 

然後,當我想跟蹤的一些按鈕的一些事件,我的主視圖控制器,我添加以下代碼:

#import "GAI.h" 
#import "GAITracker.h" 

    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker]; 


    if (button.tag==0){ 
     [tracker sendEventWithCategory:@"Preview" 
          withAction:@"Click" 
          withLabel:@"DeckB" 
          withValue:[NSNumber numberWithInt:100]]; 
    } else if (button.tag==1){ 
     [tracker sendEventWithCategory:@"Preview" 
          withAction:@"Click" 
          withLabel:@"DeckC" 
          withValue:[NSNumber numberWithInt:100]]; 
    } 

在我的谷歌Analytics帳戶我創造了這樣的事件:

  1. 我去了目標,然後設定了新的目標。
  2. 配置的不同領域,併爲我的事件:類與前瞻行動一致與點擊標籤匹配與DeckB/DeckC匹配和空值

如果我跑我的應用我看到類似這樣的消息:

GoogleAnalytics 2.0b4 -[GAIDispatcher cancelTimer] (GAIDispatcher.m:224) DEBUG: Canceled timer with interval 20.0s 

這是否意味着它設置正確?我應該看到幾個小時後,我確實點擊了一個按鈕,還有什麼我應該做的?我只想看看這兩個按鈕被按下多少次。

蘋果審查過程不會有問題,對吧?

回答

2

如果它起作用,那麼這個消息意味着什麼。如果你是死一般關心的是日誌消息,然後改變這一行:

[GAI sharedInstance].debug = YES; 

要這樣:

[GAI sharedInstance].debug = NO; 

但是,如果目前不工作,我會檢查你的設置爲谷歌分析。我不使用它,所以如果它無法正常工作,我不是正確的人。

它不應該干擾應用程序審查過程。

希望這會有所幫助。

相關問題