This means a command reached the _paq array, or a tracker method was called directly, before the Matomo JS tracker file finished loading and processing the queue - usually because the snippet loaded asynchronously and something called a tracker method before that script executed, or because a duplicate _paq array shadowed the real queue.
Why this happens
Matomo's client-side tracker works like classic Google Analytics: _paq starts life as a plain JavaScript array that queues commands, and only becomes a "real" tracker once matomo.js loads and processes everything already sitting in the queue. If your page defines _paq in more than one place - a duplicate snippet, one copy from a tag manager and one hardcoded copy - or if code elsewhere calls tracker methods directly on Matomo.getTracker() before that call can succeed, you get this warning because the queue mechanism assumes only one array feeding one tracker instance.
Fix it
- Confirm the Matomo tracking snippet appears exactly once on the page - search your codebase and any tag manager container for duplicate insertions.
- Push all tracking calls through
_paq.push([...])syntax rather than callingMatomo.getTracker()synchronously elsewhere, unless you explicitly wait for the tracker to be ready. - If you need the actual tracker instance, use the callback form:
_paq.push([function() { var tracker = this; }])- it runs only once the tracker is truly ready, avoiding the race entirely. - In single-page apps, route route-change tracking through _paq.push() as well, not a direct method call that assumes the tracker object already exists.
- Check script load order if you self-host matomo.js behind a CDN or reverse proxy - a slow or blocked load of that one file is the most common actual root cause behind the warning appearing intermittently.
How to verify it worked
Open the console and run typeof _paq !== "undefined" && _paq.length - after the tracker has loaded, previously queued commands should have drained (length near 0). In Matomo's admin, use the Real-Time Visitors widget to confirm a manual page visit registers within seconds.