Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced E-Commerce Tracking with this library? #33

Open
simplenotezy opened this issue Apr 22, 2020 · 3 comments
Open

Enhanced E-Commerce Tracking with this library? #33

simplenotezy opened this issue Apr 22, 2020 · 3 comments

Comments

@simplenotezy
Copy link

How do I send enhanced e-commerce tracking with this library? Currently I have tried like so:

		this.$gtag('event', 'transaction', {
			ecommerce: {
				purchase: {
					actionFields: {
						id: '123',
						revenue: '4.56',
						tax: '0.00',
						shipping: '1.00',
						coupon: ''
					},
					products: [
						{
							id: this.product.id,
							name: this.product.title
						}
					]
				}
			}
		});

The event does indeed fire, but nothing shows up in Google Analytics.

Not sure if I have to approach this differently.

@simplenotezy
Copy link
Author

I have also tried with:

		this.$gtag('event', 'purchase', {
			transaction_id: '123',
			value: 4.56,
			currency: 'EUR',
			tax: '0.00',
			shipping: '1.00',
			coupon: '',
			items: [
				{
					id: this.product.id,
					name: this.product.title,
					price: '123',
					quantity: 1
				}
			]
		});

Same issue. Event gets fired, but no data show up in Analytics or in "GTM/GA Debugger for Chrome" under Enhanced E-commerce tab.

@simplenotezy
Copy link
Author

simplenotezy commented Apr 22, 2020

After several attempts to modify the event data in different ways, and hours of debugging, I failed to get enhanced e-commerce tracking to work with this library.

I instead tried my luck with https://github.com/mib200/vue-gtm and it worked after 5 minutes.

I can send a purchase event like so:

		this.$gtm.trackEvent({
			event: 'transaction',
			ecommerce: {
				purchase: {
					actionFields: {
						id: '123',
						revenue: '4.56',
						tax: '0.00',
						shipping: '1.00',
						coupon: ''
					},
					products: [
						{
							id: this.product.id,
							name: this.product.title
						}
					]
				}
			}
		});

@nachiomdq
Copy link

It's and old post, but thanks @simplenotezy i was stuck on the same problem. I will try to move to vue-gtm, because this module doesn't work at all with transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants