nuxt-community / google-gtag-module

Enable google gtagjs for NuxtJs
MIT License
148 stars 27 forks source link

UTM parameters are not tracking without page reload. #18

Open mehidi258 opened 5 years ago

mehidi258 commented 5 years ago

I'm using @nuxtjs/google-gtag module with this option. It's working perfectly for page views, but utm parameters are not working without page reload. { id: process.env.NUXT_ENV_GTAG_ID, config: { anonymize_ip: true, send_page_view: true }, debug: process.env.NODE_ENV === "production" ? false : true, disableAutoPageTrack: false }

dohomi commented 5 years ago

@mehidi258 try this approach: https://github.com/nuxt-community/google-gtag#to-make-sure-that-every-page-is-tracked-correctly

mehidi258 commented 5 years ago

@dohomi Thanks for your feedback. I tried with this approach also but still not working. I'm getting page view as expected but not getting UTM tracking without page reload. Ex. /somePath/?utm_source=frontPage&utm_medium=menu I want to track Source/Medium without page reload.

dohomi commented 5 years ago

I honestly have no idea why thats not working.. doesn't seem to be an issue with gtag.. maybe try Google Tag Manager instead?

mehidi258 commented 5 years ago

Hi @dohomi figure out the issue and fixed it. It's perfectly working now for me that's why i have submitted a PR please review it. Thanks again @dohomi