Set GA tracking ID outside of Nuxt Config somehow?
See original GitHub issueIt would be great if there was a way to add the tracking IDs into this module somehow. Currently I use nuxtServerInit
to fetch them via Apollo add them into Vuex, but I can’t get them into Nuxt Config obviously.
Because the tracking codes are stored in our CMS, and we like clients to be able to change them without requiring a code change from us.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Set GA tracking ID outside of Nuxt Config somehow? #9 - GitHub
Currently I use nuxtServerInit to fetch them via Apollo add them into Vuex, but I can't get them into Nuxt Config obviously.
Read more >Options - Google Analytics Module for Nuxt
The tracking ID of your Google Analytics account. It is required to have Google Analytics (GA) know which account and property to send...
Read more >nuxtjs/google-tag-manager only add google analytics when ...
My website uses Nuxtjs and the @nuxtjs/google-tag-manager. In the nuxt-config.js I set it up like this modules: [ 'nuxt-leaflet', '@nuxtjs/ ...
Read more >Add custom tracking events to your nuxt site with GA4
Tracking with GA4 can be very useful, here's a little guide on tracking things you find important with custom GA4 events in Nuxt....
Read more >Track Single Page App with Google Analytics 4 and Google ...
Learn how to track Single Page Web App with Google Tag Manager (or Single Page Website), and send that pageview data to Google...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For future reference, this is what I ended up with and it seems to work great. The only thing I’ not sure on is @dohomi has
defer = true
on the script, but google hasasync = true
so I went with that instead.I guess you are looking for something like this:
wrap this code into a function and just load it as long the script never been loaded before. I hope this leads you to the right way