I am not sure I fully understand the Google Analytics integration. At least, what I read on Google’s SDK Page and what I see in reality are not the same.
I’ve setup the Tracker in my applicationDidFinishLaunching method, with my key.
[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-xxxxxxxx-1"
dispatchPeriod:30 // SENDS EACH 30 SECONDS.
delegate:self];
NSError *error;
if (![[GANTracker sharedTracker] setCustomVariableAtIndex:1
name:@"iPhone"
value:appVersion
withError:&error]) {
// Handle error here
ALog("Google Analytics Error: %@", error);
}
if (![[GANTracker sharedTracker] trackPageview:@"/app_did_finish_Launching"
withError:&error]) {
// Handle error here
ALog("Google Analytics Error:%@", error);
}
I am using a delegate to ensure that the dispatch is firing, and it is, and each time it says it is successful.
- (void)trackerDispatchDidComplete:(GANTracker *)tracker
eventsDispatched:(NSUInteger)eventsDispatched
eventsFailedDispatch:(NSUInteger)eventsFailedDispatch {
DLog(@"events dispatched: %d, events failed: %d", eventsDispatched, eventsFailedDispatch);
}
Question 1:
I am trying to see this over WIFI, with a proxy I’ve setup between my iPhone and the web. I see nothing that looks like Google analytics traffic. Should I expect to see anything?
Question 2:
Its been 24 hrs, and I don’t see anything on the Google Analytics site. Should I see something? I’ve had success with this implementation only when I set the dispatchPeriod to 0, and manually call dispatch in the code.
BOOL success = [[GANTracker sharedTracker] dispatch];
But I really don’t want to do this in a shipping app version.
What am I doing wrong? Do I need to call dispatch manually? The SDK implied you only call the dispatch if you want to send it manually (without batching the sends). Am I understanding this correctly?
Thanks for your help.
-Yenyi
Well, it takes a long time to update. More than 24 hrs. But it does update. In the end, decided to go with Flurry, the API was just cleaner.