How to track row select event in table in iOS

How to track events using Google Analytics? I can track screen names, but I cannot track events. I have a code like this:

[[GAI sharedInstance].defaultTracker trackEventWithCategory:@"UIAction" withAction:@"buttonPress" withLabel:@"Next button to second page" withValue:[NSNumber numberWithInt:1]]; 

But what is the category, action, label and meaning in it?

I want to track row selection in a table. So how can I create an event for this?

0
source share
1 answer

You need to put your code inside the tableView:didSelectRowAtIndexPath: method to track table row selection. Then you need to correctly name the category, action and label. I would recommend something like this:

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

Actually, you can name the category, action and label what you want. But it’s better to give them convenient names, so they are easier to find in statistics.

+1
source

All Articles