user2843105
user2843105

Reputation: 55

Error Implementing Google Analytics to iOS

I am trying to add Google Analytics to my iOS app. I have added all the right frameworks to Xcode. I followed through the SDK v3 startup guide. But when I added:

self.trackedViewName = @"About Screen";

to my viewcontroller, I got an error saying

Property trackedViewName not found on object of type ViewController

On my .h file, I imported GAITrackedViewController.h and added GAITrackedViewController to the interface.

What do you think the problem could be?

Upvotes: 3

Views: 1370

Answers (3)

doruvil
doruvil

Reputation: 93

Check the answer from here: https://developers.google.com/analytics/devguides/collection/ios/v3/migration

Users of Automatic Screen Tracking should replace references to GAITrackedViewController.trackedViewName with GAITrackedViewController.screenName.

Upvotes: 1

Ankur SIngh
Ankur SIngh

Reputation: 9

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol GAITracker;
@interface GAITrackedViewController : UIViewController {
@private
    id<GAITracker> tracker_;
    NSString *trackedViewName_;
}
@property(nonatomic, assign)id<GAITracker> tracker;
@property(nonatomic, copy)NSString *trackedViewName;
@end

Paste this code on GAITrackedViewController.h file.
Then you can use self.trackedName = @"Some Name"; easly.

Upvotes: 1

Nazik
Nazik

Reputation: 8444

You can try screenName instead of trackedViewName

self.screenName = @"About Screen";

This solved my issue.

Upvotes: 8

Related Questions