import VueGtm from 'vue-gtm';
Vue.use(VueGtm, {
id: config.services.googleTag.id,
queryParams: config.services.googleTag.gtm_auth ? { // Add url query string when load gtm.js with GTM ID (optional)
gtm_auth: config.services.googleTag.gtm_auth,
gtm_preview: config.services.googleTag.gtm_preview,
gtm_cookies_win: config.services.googleTag.gtm_cookies_win
} : {},
defer: false, // defaults to false. Script can be set to `defer` to increase page-load-time at the cost of less accurate results (in case visitor leaves before script is loaded, which is unlikely but possible)
enabled: true, // defaults to true. Plugin can be disabled by setting this to false for Ex: enabled: !!GDPR_Cookie (optional)
debug: true, // Whether or not display console logs debugs (optional)
vueRouter: router, // Pass the router instance to automatically sync with router (optional)
});
I added history change event and variables in GTM. If I refresh the page, google analytics can see the url in reports->realtime->overview. but if I change the route by router-link, it doesn't show anything at all(no changes in google analytics).
I have the following:
I added history change event and variables in GTM. If I refresh the page, google analytics can see the url in reports->realtime->overview. but if I change the route by router-link, it doesn't show anything at all(no changes in google analytics).
I even tried this in router watcher:
It comes here, logs everything, in the debug, it shows this event is thrown, but in google analytics, still nothing until i refresh the page.
Any idea what I might be missing ? should I also have
vue-analytics
plugin installed ? but why ? this plugin should be doing that..NOTE: I am using custom environments..