i have been trying to add google analytics to my app in development by following an online text tutorial which was ok at first but right at the end i get an error on this code... (specifically the code in the .m file)
Two things:
When i go on google analytics, i dont register any information and the line of code right below registers an error when i try to compile and run
Another thing is in all this code is there a section im supposed to put the tracker ID from google analytics?
P.S is it ok to include a link tot he tutorial i was following so that you guys know what im talking about? i dont wanna get banned so thought i would ask first...
- (IBAction)tappedButtonOne:(id)sender {
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker sendEventWithCategory:@"MyFirstScreen"
withAction:@"ButtonPress"
withLabel:@"ButtonOne"
withValue:nil];
}
here is the code i have in the .h
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
#import "GAITrackedViewController.h"
@interface ViewController : GAITrackedViewController <ADBannerViewDelegate>
@property (retain, nonatomic) IBOutlet ADBannerView *banner;
@property (retain, nonatomic) IBOutlet UITextView *txtinfo;
- (IBAction)tappedButtonOne:(id)sender;
@end
and here is the code i have in the .m
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)dealloc {
[_banner release];
[_txtinfo release];
[super dealloc];
}
- (IBAction)tappedButtonOne:(id)sender {
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker sendEventWithCategory:@"MyFirstScreen"
withAction:@"ButtonPress"
withLabel:@"ButtonOne"
withValue:nil];
}
@end