Skip to content
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

How to replace page path variable of the google tag manager using @nuxtjs/gtm? #142

Open
AtiqulHaqueTikweb opened this issue Dec 3, 2021 · 0 comments

Comments

@AtiqulHaqueTikweb
Copy link

AtiqulHaqueTikweb commented Dec 3, 2021

I have a route called create-event in my nuxtjs project and on this page, I have an event form that has some steps. I want to track those steps in the google tag manager. If I move from one route to another when clicking on the next button that time it's working. For example, when I am clicking on the create button that time it changed route from http://localhost:4444/create-event-dynamic-url to http://localhost:4444/create-event-dynamic-url/step-musician-type that time google tag manager tracked it correctly. But when I want to do the same thing without route changing using this.$gtm.push({ 'event': 'nuxtRoute', 'pagePath': process.env.SERVER_BASE_URL + this.$nuxt.$route.path+'/step-musician-type' }) that time it's not working. Now actually, I want to replace the original nuxt route path in the google tag manager using $gtm.push({}). Is it possible? Can anyone help me with it?

I have also asked the same question in the stack overflow and here is the ( link https://stackoverflow.com/questions/70212271/how-to-replace-page-path-variable-of-the-google-tag-manager-using-nuxtjs-gtm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant