Skip to main content

Offline Queue

Why a queue?

Sometimes:

  • The Matomo JS is still loading\
  • The user is offline\
  • The browser is slow

In those cases — your app should not lose tracking events.


How it works

react-matomo-kit has a built-in queue:

  • If Matomo is not ready — events are queued\
  • When Matomo is ready — events are sent automatically

No extra code needed 🚀


Configuring queue size

You can set:

<MatomoProvider config={matomoConfig} queueLimit={100}>
<MatomoAutoPageView />
<App />
</MatomoProvider>

Default: 50 events

If the limit is exceeded — oldest events are dropped.


Monitoring queue

You can check queue status:

const { queueSize, lastFlushTimestamp, droppedEventsCount } = useMatomo();

That’s it — the queue works for you, no manual setup needed 🚀