Closed toritroniks closed 4 years ago
gtag.js is the only library loaded here, why would analytcs.js be loaded as well? they are 2 separate libraries
I am also running to the same issue. So we are supposed to add google snippet to our head correct?
you are not supposed to add any snippets. vue-gtag loads gtag.js and no other libraries. why would you use analytics and gtag at the same time?
Sorry if I am misunderstanding the plugin. I am new to this. Please tell me where is my mistake.
this.$gtag
, but nothing was sent to the Analytics console.after the account creation, there is an instruction to add this snippet to the <head>
tag.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1234567-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-1234567-8');
</script>
if I do this, analytics.js is automatically added to the page. (even though I am not directly adding it)
I also saw that in this other issue, analytics.js seems to be automatically added for him. https://github.com/MatteoGabriele/vue-gtag/issues/119#issue-607530088
Not sure what I am missing.
I think you cannot use the GA TrackID directly without adding it to your GTM. I am still looking further into it, I will comment if I make it work :)
Got the same issue. When I trying to add vue-analytics Tag Assistant says that there are few gtag instances. But if I use only vue-gtag it recommends adding google analytics.
just saying it out there, but it could be related to this issue. I will have a look later
:tada: This issue has been resolved in version 1.6.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
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.
My setup is on the
main.js
file: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.Am I missing something? Any help would be appreciated!
Thanks in advance.
Environment
vue-gtag@1.6.3