Closed siulca closed 6 years ago
Yeah, the underlying problem is that vue-router calls the afterEach
listeners before the page contents and even the window.location
changes. https://github.com/AmazingDreams/vue-matomo/blob/master/src/index.js#L40
Perhaps a solution would be to set a timeout to like 50ms or something, and then signal the matomo tracker to track a page view
Would that explain the inconsistency with the page URLs also? Sometimes they are tracked with a forward slash, sometimes aren't.
Would you be able to implement that delay in vue-motomo itself? It'd be all self-contained that way and maybe provide a delay variable that can be setup via the setup options object.
Yeah, I couldn't use the window.location so I had to construct my own page url from the data given by the router. It depends on your router definition. Maybe you have extra forward slashes there.
A timeout is perhaps better. Just let matomo figure it out, they've put a lot of work into page tracking already so.
Unfortunately matomo simply isn't built for out of the box tracking of single page apps. I've tried some stuff but I'm back to using my own (slightly improved) url determination code.
I'm using the route's name, do you think this could be causing issues for you?
Yeah, because route names aren't compulsory.
Unfortunately matomo simply isn't built for out of the box tracking of single page apps.
What makes you believe this?
What makes you believe this?
It simply won't update the page url by itself.
See if v0.5.1 works for you.
Will try later. What are you using bootstrap for?!
I'm not using bootstrap CSS framework. bootstrap.js is the script that pulls in the matomo JS
You mean you're using bootstrap to load matomo? Can't it be done with Axios?
No it's just the name I used for the script, not a library
I'll close this one for now feel free to reopen.
I'm using vue-matomo with a package that enables changing the page title upon route change. However the tracking of page titles isn't working consistently. Something motomo tracks the title, sometimes it tracks the URL as the title. Sometimes it tracks the title as ''Page Name Not Defined"