SomeGuy
SomeGuy

Reputation: 9690

Google Analytics not logging events with a value

Google Analytics is not logging events with a value, when I remove the value it is successfully logged (and shows up on the web viewer)

This does not get logged:

[self.tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Test1234"
                                                           action:@"Action"
                                                            label:@""
                                                            value:@(1.25)] build]];
[[GAI sharedInstance] dispatch];

This does get logged:

[self.tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Test1234"
                                                           action:@"Action"
                                                            label:@""
                                                            value:nil] build]];
[[GAI sharedInstance] dispatch];

Am I doing anything wrong?

Upvotes: 1

Views: 135

Answers (1)

TimmyCarbone
TimmyCarbone

Reputation: 445

Unfortunately, Google Analytics does not recognize floating event values (1.25 here).

Event values must be integers.

If the precision matters, a workaround for you would be to multiply your event value per 100 (so, in your case, it would be 125 which is an integer).

Be careful if you hand off your data to an other service taking action with the event values without pre-treatment (like Adwords ...). You don't want those services to consider 125 as your event value.

Upvotes: 2

Related Questions