You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been having an intermittent issue when using vue-matomo and Nuxt together. Sometimes when refreshing a page, Matomo doesn't load correctly, whereas when routing via the site's navigation, it is fine. So when trying to use this.$matomo we get "id" is undefined, simply because the plugin hasn't loaded at that point.
We've tied instantiating it in different places, mounted(), beforeUpdated() etc but the problem still happens if the user chooses to refresh the page manually.
One option we've thought of, is to implement a timeout but there must be a better way. Please advise. Thanks!
The text was updated successfully, but these errors were encountered:
Unfortunately Matomo is loaded seperately and this.$matomo is not defined until Matomo is loaded. On top of that adblockers / anti-tracking plugins might block Matomo from loading entirely and this.$matomo may not become available ever.
I suggest using the window._paq.push method as documented by Matomo, it would be the easiest way to circumvent this as Matomo will just read the array when it is loaded and you don't need timeouts etc https://developer.matomo.org/guides/tracking-javascript-guide
We've been having an intermittent issue when using vue-matomo and Nuxt together. Sometimes when refreshing a page, Matomo doesn't load correctly, whereas when routing via the site's navigation, it is fine. So when trying to use this.$matomo we get "id" is undefined, simply because the plugin hasn't loaded at that point.
We've tied instantiating it in different places, mounted(), beforeUpdated() etc but the problem still happens if the user chooses to refresh the page manually.
One option we've thought of, is to implement a timeout but there must be a better way. Please advise. Thanks!
The text was updated successfully, but these errors were encountered: