How do I reset the session with Google Analytics for iPhone?
I am using Google Analytics in an iPad app that runs on a kiosk, I need to manually reset Google Analytics session at certain points in the app, does anyone know how to do this?
The source code for the analytics on iOS does not seem to be available and the cookies used by the web version of Google Analytics don't show up in the shared cookie storage on the iOS app, so, whereby it would be easy to do this on the web by simply deleting the relevant cookies, on iOS this doesnt seem possible as those cookies are not visible, 开发者_Python百科is there a way around this?
Have you tried simply stopping and starting the tracker?
From the header:
// Start the tracker by specifying a Google Analytics account ID and a
// dispatch period (in seconds) to dispatch events to the server
// (or -1 to dispatch manually). An optional delegate may be
// supplied.
- (void)startTrackerWithAccountID:(NSString *)accountID
dispatchPeriod:(NSInteger)dispatchPeriod
delegate:(id<GANTrackerDelegate>)delegate;
// Stop the tracker.
- (void)stopTracker;
精彩评论