Kenny Wyland
Kenny Wyland

Reputation: 21860

Google Analytics for iOS, not receiving data on Google side

I'm trying to implement GA in my iOS app. In my Xcode console, I'm seeing a bunch of messages from the GA system which all appear to show successful tracking of my screen views, but I never see anything show up in my Realtime Overview in my Google Analytics Account/Property.

Here are the steps I went through:

1) Installed GoogleAnalytics via pod

2) Configured a Google Services project and added Google Analytics to it for my app via https://developers.google.com/mobile/add

3) That generated a GoogleService-Info.plist for me, I added it to my project.

4) I configured the GAI in my AppDelete:

GAI *gai = [GAI sharedInstance];
gai.trackUncaughtExceptions = YES;
gai.logger.logLevel = kGAILogLevelVerbose;
gai.dispatchInterval = 5;

5) Next I configured my View Controller to track a screen view:

- (NSString*) gaiScreenName {
    return NSStringFromClass([self class]);
}

- (void) gaiLogScreenView {
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker set:kGAIScreenName value:[self gaiScreenName]];
    [tracker send:[[GAIDictionaryBuilder createScreenView] build]];
}

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [self gaiLogScreenView];
}

In my console, it looks like everything works just fine:

2015-09-23 18:59:23.595 MyAppName[370:206928] VERBOSE: GoogleAnalytics 3.13 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:517): Saved hit: {
    parameters =     {
        "&_crc" = 0;
        "&_s" = 15;
        "&_u" = ".oK9L";
        "&_v" = "mi3.1.3";
        "&a" = 23452345;
        "&aid" = "com.inadaydevelopment.myappid";
        "&an" = MyAppName;
        "&av" = "1.1";
        "&cd" = ViewAnimalViewController;
        "&cid" = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx";
        "&dm" = "iPhone7,2";
        "&ds" = app;
        "&sr" = 640x1136;
        "&t" = screenview;
        "&tid" = "UA-XXXXXXX-2";
        "&ul" = en;
        "&v" = 1;
        "&z" = 1234123412341234;
        gaiVersion = "3.13";
    };
    timestamp = "2015-09-24 01:59:23 +0000";
}
2015-09-23 18:59:25.199 MyAppName[370:206928] VERBOSE: GoogleAnalytics 3.13 -[GAIRequestBuilder requestPostUrl:payload:compression:] (GAIRequestBuilder.m:167): building URLRequest for https://ssl.google-analytics.com/batch
2015-09-23 18:59:25.200 MyAppName[370:206928] VERBOSE: GoogleAnalytics 3.13 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:632): Sending hit(s) POST: https://ssl.google-analytics.com/batch
2015-09-23 18:59:25.492 MyAppName[370:206887] INFO: GoogleAnalytics 3.13 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:226): Hit(s) dispatched: HTTP status 200

However, I never see any of the data show up in my reports on Google Analytics. I've verified that I'm viewing the correct Account/Property/View.

What am I missing or doing wrong?

Upvotes: 0

Views: 758

Answers (2)

nynohu
nynohu

Reputation: 1658

In my case, the Real-Time view display data after about 2 minutes, not need to wait 24 hours. So I think @Kenny Wyland, you should try Real-Time to view data. If you cannot see, probably your GAI will fail to see data in tomorrow.

Upvotes: 0

Claudio Redi
Claudio Redi

Reputation: 68400

Take into account that you'll have to wait about 24 hours for stats to start showing up on control panel. This is only for initial load, after this delay, stats will show up without delay.

If after 24 hours you still see nothing, then definitively there is a problem.

Upvotes: 3

Related Questions