I was trying to implement a custom tracking pageview event using vue-router, to try to use the router meta params to generate the custom object that I need to send to my data team.
Although I find out that I can't do that with the way is is coded right now.
So in order to fix that, my suggestion would be to change the trackView method from what it is right now
I was trying to implement a custom tracking pageview event using vue-router, to try to use the router meta params to generate the custom object that I need to send to my data team.
Although I find out that I can't do that with the way is is coded right now.
So in order to fix that, my suggestion would be to change the trackView method from what it is right now
to something like:
That way at least if we want to send trackView events on the router change we can use it like this:
this.$gtm.trackView('Home', '/home-page', { action: 'page-view', category: 'Home' .... })
And if we want to make that trackview Event automátic, we could change the way we are using the router meta params:
Then in your meta params you could set the gtm property like an object
If it's something you are willing to do I would submit a PR aswell so everyone can use it.
Thanks