0

I am trying to send a screen to Google Analytics using its SDK (3.11) on iOS, but nothing is happening on the GA console, even after 24h.

I doubled checked the identifier which look like this UA-xxxxxxx-x.

Here is the code I use to setup the SDK :

  • in my AppDelegate

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    {
      [GAI sharedInstance].optOut = YES;
      [GAI sharedInstance].dispatchInterval = 1;
      [GAI sharedInstance].trackUncaughtExceptions = YES;
      [[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
      [[GAI sharedInstance] trackerWithTrackingId: self.config.googleAnalyticsTrackingId];
      return YES;
    }
    
  • in my ViewController, which inherits from GAITrackedViewController

    - (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
      self.screenName = @"MyControllerScreen";
    }
    

Any idea ?

trupin
  • 812
  • 7
  • 14

1 Answers1

2

You have opted out of analytics data tracking..

[GAI sharedInstance].optOut = YES;

Comment for optOut property clearly states..

When this is true, no tracking information will be gathered; tracking calls will effectively become no-ops.

So either set it to false optOut = NO, or just comment out that line and try again.

Swapnil Luktuke
  • 10,385
  • 2
  • 35
  • 58
  • Thanks for your answer, I actually don't know why I have put it to YES, but by rereading the documentation, you are right, this line doesn't make any sense. I deleted it and it is now working like a charm. – trupin May 07 '15 at 09:38