AmazingDreams / vue-matomo

Vue plugin for Matomo Analytics
MIT License
272 stars 60 forks source link

Site with port doesn't work 100% #109

Closed djcaesar9114 closed 1 year ago

djcaesar9114 commented 2 years ago

Hello, In my dev environment I have my app running on localhost:8080. Matomo seems to work correctly, but although the real time visits counter increments, the actions aren't correct: they show localhost/XXX and not localhost:8080/XXX. In the websites list it's correctly written localhost:8080. Am I missing something? Thanks in advance :)

AmazingDreams commented 2 years ago

Hi, this is because the way the page url is determined. The window.location was not updated in the router afterEach hook, so we had to "build" the current page url ourself or the "old" page url would always be passed to matomo (or insert some arbitrary delay or something).

However. I am currently debugging this and I'm noticing that the window.location is updated in the afterEach hook on both vue 2 and vue 3. So maybe we can use window.location again, if this is something that is fixed by Vue.

AmazingDreams commented 2 years ago

This has indeed been fixed in vue-router 3.3.0 https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md#330-2020-05-27