Floating-Dartists / matomo-tracker

A fully cross-platform wrap of the Matomo tracking client for Flutter, using the Matomo API.
https://pub.dev/packages/matomo_tracker
MIT License
26 stars 28 forks source link

queue in matomo.dart breaks tracking #33

Closed timcreatedit closed 2 years ago

timcreatedit commented 2 years ago

Describe the bug Events that get sent in the same _dequeue() loop get picked up by our Matomo instance incorrectly. This means that for example 3 quick consecutive screen views get tracked as the first view x 3 by Matomo.

To Reproduce Steps to reproduce the behavior:

  1. Send multiple events in rapid succession
  2. Verify in Matomo console

Additional context For now, we have resorted to a slightly hacky workaround of calling dispatchEvents() after each tracking call. We have tried to remove the Queue from matomo.dart altogether and it seems to work. Maybe someone could give us some context on why the Queue was implemented in the first place, because we would have a PR ready with the Queue removed that worked great in our testing.

TesteurManiak commented 2 years ago

Hi, as this package is a fork from @poitch's repository I don't know if the queue is especially needed, if you haven't experienced any issue/regression by removing it I'd be glad to see the change you've mentionned inside a PR 😄