Krunal
Krunal

Reputation: 6490

Google analytics doesn't show tracking for some pages

I developed app in which i have integrated google analytics.

My app has TabBar, : The 4 tabbar you can see in image, when i click on any of the tab it tracks the screen name in google analytics, but suppose as you can see my active tab is "Artists" it contains TableView when i click on tableview it redirects me to new viewcontroller say NewPage on this NewPage i have written code snippet of tracking but it doesn't track screen name in google analytics

#import "NewPage.h"
@interface CRIndCoponPgViewController : GAITrackedViewController{

   ...
}

@implementation NewPage
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.screenName  = @"Page which is inside Artists Tab";
       ...
       ...


}

Also tried Self.screenName = @"Page which is inside Artists Tab"; in viewWillAppear method but still it doesn't track my page.

In short: pages which are inside particular Tabbar doesn't track in analytics.

is there any mistake i am doing for inner pages ?? please help.

Thanks in advance.

Upvotes: 2

Views: 659

Answers (2)

gillyD
gillyD

Reputation: 707

The method in one is no longer available in the sdk. Use this :

  id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
  [tracker set:kGAIScreenName value:screenName];

Upvotes: 2

Selvam M
Selvam M

Reputation: 247

UITabBarController allocate view controller at once so at the first time you get hit on google analytics server if you want each time your view hit on the server then you use viewWillAppear delegate method

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    // returns the same tracker you created in your app delegate
    // defaultTracker originally declared in AppDelegate.m
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

    // manual screen tracking
    [tracker sendView:@"screen Name"];
}

Upvotes: 3

Related Questions