I would like get GA in my apps. I've tried to do this:
I used this Google Analytics SDK for iOS v3 (Beta)- https://developers.google.com/analytics/devguides/collection/ios/v3/
I've followed all the steps of the documentation. also already tried Linker errors when trying to install new Google Analytics 3.0 Beta
In my AppDelegate.h
#import <UIKit/UIKit.h>
#import "GAI.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property(nonatomic, strong) id<GAITracker> tracker;
@property (strong, nonatomic) UIWindow *window;
@end
In my AppDelegate.m
#import "AppDelegate.h"
#import "GAI.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[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.
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-47246605-1"];
[GAI sharedInstance].optOut = YES;
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].dispatchInterval = 0;
return YES;
}
ViewController.h
#import <UIKit/UIKit.h>
#import "GAI.h"
#import "GAITrackedViewController.h"
@interface ViewController : GAITrackedViewController
@end
ViewController.m
#import "ViewController.h"
#import "GAI.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.screenName = @"Home Screen";
}
Link for my project test:https://www.dropbox.com/s/j3ufrv55xym82nc/TesteAnalytics.zip