Closed rsalunga29 closed 4 years ago
As far as I can see from your example, you are defining the router
constant after initializing Vue Gtag so it's probably reading undefined as a value
As far as I can see from your example, you are defining the
router
constant after initializing Vue Gtag so it's probably reading undefined as a value
Oof, I didn't noticed this. Let me try and see if it works
If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.
Description
The auto-tracking of VueRouter pages seems to not be working, I'm currently viewing my
/articles
router but Google Analytics only displays/
as the current active route. See code on Demo sectionExpected behavior
Google Analytics should track VueRouter's routes for SPAs
Actual behavior
Nothing happens, only tracks
/
which is the index pageEnvironment
Run this command in the project folder and fill in their results:
npm ls vue-gtag
:Then, specify:
Reproducible Demo
I'm using the vue-cli for this with a separate
main.js
(entry point) androuter.js
files.router/index.js (this is the router.js file)
main.js