Ios6 iOS Google Analytics缺少第一个UIViewController
BLUF:Google Analytics iOS v2 beta 4未能跟踪我的第一个Ios6 iOS Google Analytics缺少第一个UIViewController,ios6,google-analytics,Ios6,Google Analytics,BLUF:Google Analytics iOS v2 beta 4未能跟踪我的第一个UIViewController,该控制器在成功点击后续UIViewController(子类为GAITrackedViewController) AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //
UIViewController
,该控制器在成功点击后续UIViewController
(子类为GAITrackedViewController
)
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Optional: automatically send uncaught exceptions to Google Analytics.
[GAI sharedInstance].trackUncaughtExceptions = YES;
// Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
[GAI sharedInstance].dispatchInterval = 0;
// Optional: set debug to YES for extra debugging information.
[GAI sharedInstance].debug = YES;
// Create tracker instance.
[[GAI sharedInstance] trackerWithTrackingId:@"UA-########-1"]; // id<GAITracker> tracker =
return YES;
}
我没有在工作的UIViewController
上手动调用dispatch,我也尝试了在非工作状态下调用和不调用dispatch。但这是一个谜。如果不手动调用,则不会生成日志。当我手动呼叫调度时,我收到以下信息:
GoogleAnalytics 2.0b4-[GAIDispatcher initiateDispatch:retryNumber:]
(gaispatcher.m:481)调试:没有挂起的命中
提前谢谢 事实证明,您应该真正地确保,如果您覆盖了任何方法,您也应该确保对它们调用super
我已经编写了自己的
viewdide
方法,但没有调用[super-viewdide:animated]代码>。我想这就是GoogleAnalytics发挥魔力的地方。希望这能帮助其他人不这么做。在我的例子中,我确实调用了super方法,但在某些页面上它不起作用。
我只是改变了顺序,让遗传算法在超级方法之前,它现在确实起作用了
- (void)viewDidAppear:(BOOL)animated {
self.screenName = @"mainMenu";
[super viewDidAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated {
self.screenName = @"mainMenu";
[super viewDidAppear:animated];
}
Contrary to Shu Zhang answer: super should be called first and then you should add other code:
- (void)viewDidLoad
{
[super viewDidLoad];
self.screenName = @"YourViewControllerName";
//your implementation here
}
- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
///your implementation here...
}