Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS Tracker: trackEvent bug, event value is truncated #14934

Closed
rutsoluo opened this issue Oct 1, 2019 · 11 comments · Fixed by #15408
Closed

JS Tracker: trackEvent bug, event value is truncated #14934

rutsoluo opened this issue Oct 1, 2019 · 11 comments · Fixed by #15408
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@rutsoluo
Copy link

rutsoluo commented Oct 1, 2019

We have encountered an issue with TrackEvent, when you send an event value like 12225057, the value is becoming 12225100 on matomo dashboard.

When you send an event value like 719 then it is recorded correctly.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Oct 1, 2019
@tsteur
Copy link
Member

tsteur commented Oct 1, 2019

Can you check if it's reported correctly in the visitor log? Or where is it reported wrongly?

@rutsoluo
Copy link
Author

rutsoluo commented Oct 1, 2019

It is reported wrongly in the visitor log. As I said earlier event value 12225057 is being reported as 12225100 in the visitor log.

@rutsoluo
Copy link
Author

rutsoluo commented Oct 1, 2019

There is also a bug that event value does not take string. Contrary to what the documentation says. If you pass a string to event value then visitor log shows 0.

https://matomo.org/docs/event-tracking/

@tsteur
Copy link
Member

tsteur commented Oct 2, 2019

Are you using the latest version of Matomo?

I suppose you're meaning sending like 5 instead of 5. This should work.

@rutsoluo
Copy link
Author

rutsoluo commented Oct 2, 2019

I don't know what version of Matomo I am using, I am just following the Matomo documentation:

<!-- Matomo -->
<script type="text/javascript">
  var _paq = window._paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//{$PIWIK_URL}/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', {$IDSITE}]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Code -->

@tsteur
Copy link
Member

tsteur commented Oct 2, 2019

I'm not seeing the trackEvent call there?

It be important for us to know the Matomo version before we look into this any further. Thanks

@rutsoluo
Copy link
Author

rutsoluo commented Oct 2, 2019

3.11.0

Thanks for your help

@rutsoluo
Copy link
Author

rutsoluo commented Oct 2, 2019

the example I provided was the JavaScript bootStrap, below is an example of the call we use to track an event

_paq.push(['trackEvent', 'Category', 'Action', 'name', 12225057);

@tsteur
Copy link
Member

tsteur commented Oct 2, 2019

It seems this a restriction in the database with the float type. I can for example set 12225200 but not 12225201.

MySQL says in their documentation MySQL performs rounding when storing values,

@mattab not sure if we want to change the column type as part of Matomo 4?

@mattab
Copy link
Member

mattab commented Oct 3, 2019

Can't remember now why we picked Float 🤔
but be good to change the type so we can trust that Event values are tracked properly. This could otherwise create nasty bugs... Thoughts?

@tsteur tsteur added this to the 4.0.0 milestone Oct 3, 2019
@tsteur
Copy link
Member

tsteur commented Oct 3, 2019

I'll put it into Matomo 4

@mattab mattab changed the title Matomo trackEvent bug Matomo trackEvent bug, event value is truncated Nov 11, 2019
@tsteur tsteur self-assigned this Jan 16, 2020
@mattab mattab changed the title Matomo trackEvent bug, event value is truncated JS Tracker: trackEvent bug, event value is truncated Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants