google-gtag-module
google-gtag-module copied to clipboard
Library full of bugs
I have setup using basic configuration with debug: true.
If I fire:
this.$gtag('event', 'your_event', {
testing: 123
});
Nothing happens.
If I run below script first, then it works
this.$gtag('config', 'GTM-MY-ID', {
page_title: 'test',
page_path: 'testing'
});
Which is pretty weird, because config should've already been run using the basic configuration options.
Also documentation states several places that the "UA" ID is needed, but it is indeed the "GTM" id that should be provided.
The documentation also references this code:
this.$gtag('config', 'UA-XXXX-XXX', {
page_title: this.$metaInfo.title,
page_path: this.$route.fullPath
});
However, it does not work - you can't use this.$metaInfo.title since $metaInfo will be undefined.
Forgot to mention:
when I use:
this.$gtag('event', 'your_event', {
testing: 123
});
I see "your_event" in the Network tab, but I don't see the associated data (e.g. testing.123). I do see it correctly in the "dataLayer" though.
https://github.com/nuxt-community/google-gtag/issues/34#issuecomment-630584108