question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Analytics module not working in production mode

See original GitHub issue

Version

2.2.0

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:closed
  • Created 4 years ago
  • Reactions:24
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
isaumyacommented, Oct 23, 2019

@ricardogobbosouza When will the next version be published? I am using the top-level option so in the meantime should I just do this:

googleAnalytics: {
    id: 'UA-1234567-8',
    debug: {
      sendHitTask: process.env.NODE_ENV !== 'development'
    }
  }
5reactions
rwwagner90commented, Oct 22, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found