ios - Google analytics click event shows error -
i have developed iphone app, want integrate google analytics in app.
i following link of google analytics tracking click events, https://developers.google.com/analytics/devguides/collection/ios/v2/events
but when write shows me error: no known instance method selector sendeventwithcategory
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *__strong)indexpath { [self.tracker sendeventwithcategory:@"uiaction" withaction:@"buttonpress" withlabel:@"label" withvalue:[nsnumber numberwithint:100]]; }
please , in advance.
let't try:
- (bool)sendeventwithcategory:(nsstring *)category withaction:(nsstring *)action withlabel:(nsstring *)label withvalue:(nsnumber *)value; { bool rv = no; id<gaitracker> tracker = [gai sharedinstance].defaulttracker; if(tracker!=nil) { rv = [tracker sendeventwithcategory:category withaction:action withlabel:label withvalue:value]; } return rv; } @implementation aviewcontroller { id<gaitracker> tracker; } - (void) viewdidload { tracker = [gai sharedinstance].defaulttracker; tracker sendeventwithcategory: withaction: withlabel: withvalue: }
Comments
Post a Comment