0
안녕하세요, 저는 iPhone 용 Google 애널리틱스와 조금씩 씨름 해 왔으며 10 초의 dispatchPeriod가 무시되고 있다는 것을 알고 있습니다. 내가 추적하고있는 모든 이벤트는 Google 애널리틱스 사이트에서 정상적으로 진행되지만 데이터가 업로드되는 시간은 앱이 다시 시작될 때라고 생각합니다. 파견 일정이 대기중인 모든 사건을 처리 할 수 있기를 바랬습니다.Google 애널리틱스 iPhone SDK (dispatchPeriod)
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@"App Delegate: applicationDidFinishLaunching");
[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-xxxxxxx-x"
dispatchPeriod:10
delegate:self];
NSError *error;
if (![[GANTracker sharedTracker] trackEvent:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]
action:@"launch"
label:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]
value:-1
withError:&error]) {
NSLog(@"GANTracker - %@", [error localizedDescription]);
}
[window addSubview:self.navigationController.view];
[window makeKeyAndVisible];
return YES;
}
-(void)trackerDispatchDidComplete:(GANTracker *)tracker eventsDispatched:(NSUInteger)eventsDispatched eventsFailedDispatch:(NSUInteger)eventsFailedDispatch
{
//The delegate method only gets called once at launch
NSLog(@"Google Analytics: Events Dispatched = %i | Events Failed Dispatched = %i", eve
ntsDispatched, eventsFailedDispatch);
}
을 나는과 같이 이벤트를 추적 :
나는 그렇게처럼 내 추적을 시작
if (![[GANTracker sharedTracker] trackEvent:@"preview"
action:@"preview"
label:@"preview"
value:-1
withError:&error]) {
NSLog(@"GANTracker - %@", [error localizedDescription]);
}