Analytics module not working in production mode
See original GitHub issueVersion
Reproduction link
https://codepen.io/d–c/pen/rNNLXRq?editors=0010
Steps to reproduce
In development mode, with the debug code the script works fine. In production, I do not get any hits.
googleAnalytics: {
id: "UA-147623000-1"
}
What is expected ?
Hits in production mode
What is actually happening?
No hits in production mode.
Additional comments?
I did contemplate just leaving it in dev mode enabled:true
but then the console is riddled with info which I do not wish to be seen by the user. I am using Nuxt v 2.10.1.
Do I need to change the ‘Mode’ in my Nuxt.config.js? Or shallI just use the Plugin method available on the official docs? https://nuxtjs.org/faq/google-analytics/
<div align="right">This bug report is available on Nuxt community (#c47)</div>Issue Analytics
- State:
- Created 4 years ago
- Reactions:24
- Comments:22 (3 by maintainers)
Top Results From Across the Web
Firebase analytics log event not working in production build of ...
1 Answer 1 · Go to analytics.google.com then create a firebase app. · click on Create property and choose website option. · The...
Read more >Google Analytics not working? Here are 21 ways to fix it
Google Analytics not working? Here are 21 ways to fix it. #1 Delete and Disable the cache #2 Use Google Tag Assistant and...
Read more >Troubleshooting Analytics.js | Segment Documentation
Are you loading Analytics. js? Open the JavaScript console and enter analytics . Does it return an object, as seen below?
Read more >[SOLVED][Drupal Google Analytics] Tracking Code Not ...
Here is the fix. Many users had resolved it by adding a trailing "/" to their site hostname in the profile page in...
Read more >[Solved] Google Tag Manager Preview Mode Not Working? 22 ...
To name a few: Use the Tag Assistant Chrome extension, which checks for Google pixels on the page (e.g. Google Analytics, Google Ads,...
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
@ricardogobbosouza When will the next version be published? I am using the top-level option so in the meantime should I just do this:
We should not need to manually set
sendHitTask
to true though. It sounds like something in Nuxt 2.10+ changed with regards to determining if we are in dev or prod, so this is no longer sending hits.