按照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帳戶我創造了這樣的事件:
- 我去了目標,然後設定了新的目標。
- 配置的不同領域,併爲我的事件:類與前瞻行動一致與點擊標籤匹配與DeckB/DeckC匹配和空值
如果我跑我的應用我看到類似這樣的消息:
GoogleAnalytics 2.0b4 -[GAIDispatcher cancelTimer] (GAIDispatcher.m:224) DEBUG: Canceled timer with interval 20.0s
這是否意味着它設置正確?我應該看到幾個小時後,我確實點擊了一個按鈕,還有什麼我應該做的?我只想看看這兩個按鈕被按下多少次。
蘋果審查過程不會有問題,對吧?