google-gtag-module icon indicating copy to clipboard operation
google-gtag-module copied to clipboard

Library full of bugs

Open simplenotezy opened this issue 5 years ago • 2 comments

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 avatar Apr 22 '20 10:04 simplenotezy

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.

simplenotezy avatar Apr 22 '20 10:04 simplenotezy

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

PipocaZalas avatar May 19 '20 05:05 PipocaZalas