Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

track event on the basis of selected row of the table through google analytics

I have been trying this code to track which row of the table is been selected using google analytics

NSString *label=[NSString stringWithFormat:@"Section#%i",indexPath.section];
    [[GAI sharedInstance].defaultTracker trackEventWithCategory:@"HOME"
                                                     withAction:@"Select Row"
                                                      withLabel:label
                                                      withValue:[NSNumber numberWithInt:indexPath.row]];

But i always get the error "No known instance method for selector trackEventWithCategory:withAction:withLabel:with Value:"

Can anyone please guide me: I want to track which row of the table is selected so an event can be created using google analytics.

like image 899
pooja_1205 Avatar asked Apr 29 '14 09:04

pooja_1205


People also ask

What events are automatically tracked by Google Analytics 4?

Events in Google Analytics 4 This means that when you create a new GA4 property and data stream, basic user interactions such as outbound link clicks, scrolls, file downloads, video engagement, and site search are automatically tracked.

What is an event action in Google Analytics?

An event allows you to measure a distinct user interaction on a website or app. For example, loading a page, clicking a link, and completing a purchase are all interactions you can measure with events. If you're migrating from Universal Analytics, read this migration guide instead.


1 Answers

I finally got the solution

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
  [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"BUSINESS DETAILS "     
                                       action:@"Select Row"  // Event action (required)
                                       label:@"Selected"          // Event label
                                       value:[NSNumber numberWithInt:indexPath.row]] build]];    
like image 139
pooja_1205 Avatar answered Oct 25 '22 17:10

pooja_1205