I am using Google Analytics Beta 2.0 to track events in an iOS application.
Screen tracking seems to be not an issue, but when I attempt to track an event the website states it says "122 of your visits sent events", but there are no events tracked.
Here is the code for the event tracking:
[self.tracker trackEventWithCategory:@"Question Results"
withAction:@"Finished questions"
withLabel:@"Testing"
withValue:[NSNumber numberWithInt:1]];
Which is straight from the google analytics website.
Thanks for the assistance.
Try this code. It works for me.
[[GAI sharedInstance].defaultTracker trackEventWithCategory:@"UIAction"
withAction:@"buttonPress"
withLabel:@"Next button to second page"
withValue:[NSNumber numberWithInt:1]];
Add the above code into -(IBAction)buttonClicked:(id)sender;
In your Google Analytics page go to app home -> my dashboard -> in that choose add widget -> choose table in that add a Dimension as Event Label, add a metric as Event Value and add a metrics to total events and save.
Don't forget to choose the date which is in the right-top corner.
Once the event is fired it ll added in google analytics. but it ll take time to show events in Google Analytics.
You have to build the tracker send event with googleAnalytics. see follow
-(IBAction)buttonClicked:(id)sender{
//Track your event with Google Analytics
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Category Name"
action:@"Event Action"
label:@"Action Label(Button)"
value:@"value (int)"] build]];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With