New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass router parameters? #17
Comments
It seems this can be accomplished by changing this line from Vue.analytics.trackView(to.meta.analytics || to.name) to Vue.analytics.trackView(to.meta.analytics || to.path) Obviously, I suppose some people would want |
Hey! I agree with the idea, I'll make something to take that it parameter. Best regards |
Hey buddy just made a fix, Add a meta attribute
vueRouter.afterEach(to => {
// Ignore some routes
if (ignoredViews && ignoredViews.indexOf(to.name.toLowerCase()) !== -1) {
return
}
// If specified : the system will use the path instead of the route name.
const viewName = to.meta.usePathAnalytics ? to.path : to.name
// Dispatch vue event using meta analytics value if defined otherwise fallback to route name/path.
Vue.analytics.trackView(to.meta.analytics || viewName)
})
` |
@goobdeveloper Poke, you agree with that ? |
@ScreamZ I haven't tried it, but just looking at it, it seems okay to me, so I think you should merge it in. I will update versions and try it that way. |
Hey @ScreamZ can we get this merged please? :) |
@cspeer released under |
Great, thanks! Quick question though: Does this work as a global setting or do I have to pass this along with every route? |
As you can see this is passed at every routes for now. You can submit a PR to this, but I think it's better if you disable router integration and implement the above snippet on your own if you need such functionnality |
yeah, I implemented it on a per route basis now. Thanks again! |
Hi. Great plugin, thanks for making it. Installation was very easy.
My current issue, though, is that, if I just use the default router integration which passes the route name to GA, none of the route parameters are sent. e.g. visiting
/#/users/1
only sends/users
to GA, instead of/users/1
. Is there a way to make it pass the params, too, other than manually callingthis.$ua.trackView(constructedScreenName)
myself?The text was updated successfully, but these errors were encountered: