Open
Description
📚 What are you trying to do?
I've been trying to setup Matomo tracking but it only tracks the pageview on hard refreshes.
🔍 What have you tried?
So far I've created a client plugin (url omitted).
export default defineNuxtPlugin((nuxtApp) => {
const router = useRouter()
const {proxy} = useScriptMatomoAnalytics({
matomoUrl: 'https://',
siteId: '1',
disableCookies: true,
enableLinkTracking: true,
trackPageView: false
})
if (process.client) {
router.afterEach((to) => {
setTimeout(() => {
proxy._paq.push(['setDocumentTitle', document.title])
proxy._paq.push(['setCustomUrl', window.location.pathname + window.location.search])
proxy._paq.push(['trackPageView'])
}, 100)
})
}
})
I've also tried a nuxt finish hook and a watcher without success.
ℹ️ Additional context
No response