Mobile app version of vmapp.org
Login or Join
Frith620

: Google analytics - how do I submit a non-integer event value? I'm using the following code to submit events to GA: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

@Frith620

Posted in: #GoogleAnalytics

I'm using the following code to submit events to GA:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','analytics');

var ga = function() {};
analytics('create', 'UA-90679999-1', 'auto');
analytics('send', 'event', 'item', 'purchase', 'none', '0.13');
</script>


The manual says that the event value should be an integer and I've just verified that it doesn't work with non-integers.

However oddly enough some items have fractions in their prices, and it seems dumb to always have to divide the event/goal values I see in GA by 100 if I submit in cents. Is there a workaround to send non-integer values to GA?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith620

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme