Mikael
Mikael

Reputation: 5489

Integrating Google Analytics easytracker in my iOS App

The description of easytracker it state the following:

   Use TrackedUIViewController to automatically emit pageviews when the view
// associated with the controller appears. 

And then if you look at the example they do the following:

#import "EasyTracker.h"

@interface FirstViewController : TrackedUIViewController

However in my case the interface look like this:

@interface MyTableViewController : UITableViewController<FBRequestDelegate,
FBDialogDelegate,UIGestureRecognizerDelegate>{
    User *user;
    Fam *fam;
}

what should I do to add the tracking?

Upvotes: 5

Views: 2732

Answers (2)

Thomas Besnehard
Thomas Besnehard

Reputation: 2095

You can do a manual screens tracking here is google doc for it.

Manual Screen Tracking

To manually track a screen view, call trackView: as in the following example:

id<GAITracker> googleTracker = [[GAI sharedInstance] trackerWithTrackingId:@"YOUR-IUD"];
[googleTracker trackView:@"home screen"];

Upvotes: 10

kturner
kturner

Reputation: 1111

Well, if you are trying to use a UITableViewController, that likely means you have a table view within your view controller. To keep that functionality, you need to create a table view yourself, and assign your view controller as the data source and delegate of that table view. That way, your view controller will continue to implement the table view's data source and delegate methods. I would suggest using Interface Builder, and dropping a table view onto MyTableViewController.

Your interface would then look something like this:

@interface MyTableViewController : TrackedUIViewController <UITableViewDataSource, UITableViewDelegate>

You'll also most likely find yourself needing to wire up the table view as a property on your view controller.

@property (strong) UITableView *tableView;

Upvotes: 1

Related Questions