現在、ページビューとイベントを追跡するために Ipad アプリケーションで Google Analytic を使用しています。すべての viewController とボタン クリック イベントに対して以下のコードを実装しましたが、ビューが消えるとアプリケーションが停止/クラッシュ[[GANTracker sharedTracker] stopTracker];
します。
[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-12345678-1"
dispatchPeriod:kGANDispatchPeriodSec
delegate:nil];
NSError *error;
if (![[GANTracker sharedTracker] setCustomVariableAtIndex:1
name:@"iPad3"
value:@"iv1"
withError:&error]) {
// Handle error here
}
if (![[GANTracker sharedTracker] trackEvent:@"my_category"
action:@"my_action"
label:@"my_label"
value:-1
withError:&error]) {
// Handle error here
}
if (![[GANTracker sharedTracker] trackPageview:@"/app_entry_point_prashant"
withError:&error]) {
// Handle error here
}
[[GANTracker sharedTracker] stopTracker];