Is it possible to track the app with Google Analytics in IOS Simulator?

偶尔善良 提交于 2019-12-11 01:34:02

问题


I tried to track my app using Google Analytics but didn't see when it opened in "real-time mode".

I'm using Google Analytics for Mobile Apps iOS SDK v3.

In Delegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
    // 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 = 20;

    // Optional: set Logger to VERBOSE for debug information.
    [[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];

    // Initialize tracker.
    [[GAI sharedInstance] trackerWithTrackingId:@"UA-MYTRACKID-HERE"];

    return YES;
}

Maybe, it's not possible in IOS Simulator?


回答1:


Google Analytics work in iOS Simulator too. Just give it a little time in order to appear in real time data (usually 5-10 secs). The only issue with the simulator is that Google Analytics may report the iPad simulator as an iPhone but this is not such a big deal.



来源:https://stackoverflow.com/questions/19933989/is-it-possible-to-track-the-app-with-google-analytics-in-ios-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!