nuxt-community / google-gtag-module

Enable google gtagjs for NuxtJs
MIT License
145 stars 29 forks source link

multiple domains to an app id: 'UA-XXXX-XX', #11

Closed mahi2net closed 4 years ago

mahi2net commented 5 years ago

Hi I need to change the id: 'UA-XXXX-XX', dyanamically based on window.location.hostname. Is it possible and how ?

dohomi commented 5 years ago

yes you can use it for example in a router hook or on mounted. Simply call this.$gtag('config','YOUR_KEY') https://github.com/nuxt-community/google-gtag#usage

ricardogobbosouza commented 4 years ago

@dohomi can closed?