今私は私のIViewアプリケーションを使用して、私のすべてのviewControllerとボタンのクリックイベントのコードの下に実装したページビューとイベントを追跡していますが、私のビューが消えるとアプリケーションが停止する/ crash.I viewWillDisappearのstopTrackerコード[[GANTracker sharedTracker] stopTracker];
方法。Googleアナリティクス[[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];