nuxt-community / google-gtag-module

Enable google gtagjs for NuxtJs
MIT License
145 stars 29 forks source link

Library full of bugs #31

Open simplenotezy opened 4 years ago

simplenotezy commented 4 years ago

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.

simplenotezy commented 4 years ago

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.

PipocaZalas commented 4 years ago

https://github.com/nuxt-community/google-gtag/issues/34#issuecomment-630584108