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.

GoogleAnalytics not being added

See original GitHub issue

Description

I followed the documentation to add a new Analytics account to my vue application. But events are not being sent to Analytics.

When I use the “Tag Assistant” plugin, it says that the gtag.js is set, but the analytics is not added. I checked the devTools, and I couldn’t find the analytics library being added.

<link href="https://www.googletagmanager.com" rel="preconnect">
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-1234567-8" charset="utf-8"></script>

My setup is on the main.js file:

import VueGtag from 'vue-gtag';

Vue.use(
  VueGtag,
  {
    config: { id: 'UA-1234567-8' },
  },
  router
);

If I manually add this snippet to my index.html, it seems to work, but I thought that by using this plugin, this step should not be necessary.

window.dataLayer = window.dataLayer || [];
function gtag() {
  dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'UA-1234567-8');

Am I missing something? Any help would be appreciated!

Thanks in advance.

Environment

vue-gtag@1.6.3

  1. Operating system: Windows
  2. Browser and version: Google Chrome Version 83.0.4103.97 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
MatteoGabrielecommented, Jun 16, 2020

just saying it out there, but it could be related to this issue. I will have a look later

https://github.com/MatteoGabriele/vue-gtag/issues/144

1reaction
MatteoGabrielecommented, Jun 16, 2020

🎉 This issue has been resolved in version 1.6.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Your Google Analytics Isn't Working (and How to Fix It)
The most common Google Analytics setup issues · 1. Your Google Analytics tracking code is not implemented correctly · 2. You're not tracking...
Read more >
Google Analytics Not Working: 20 Common Errors & How to ...
One of the most common mistakes new users make is when adding the Google Analytics tracking code. Not knowing where to place the...
Read more >
Troubleshoot tag setup and no-data issues - Analytics Help
This troubleshooter is designed to help you resolve issues with the setup of your Analytics tag. Select the issue that most closely matches...
Read more >
What to Do When Google Analytics is Not Tracking
Have you reviewed your Google Analytics tracking code? · Have you added the tracking code to every page of your site? · Do...
Read more >
29 Common Google Analytics Data Errors And How To Fix Them
Solution A – Date & Time settings don't match. This is an easy error to fix but one that can screw your data...
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