mib200 / vue-gtm

Simple implementation of Google Tag Manager in Vue.js 2.0
Apache License 2.0
242 stars 85 forks source link

Ecommerce events are sending undefined values #69

Closed michaelsmedley closed 4 years ago

michaelsmedley commented 4 years ago

Hi there

Got a bit of an interesting issue, and wonder if you can help?

I am using this plugin as part of Vue Storefront, and for the most part everything is working - pages views and events like addToCart etc are all working fine.

However, on my order confirmation page, I am trying to send a transaction object, which from what I can see is building fine, however when looking at analytics output, it seems to be sending an object with undefined values i.e. {id: undefined, affiliation: undefined, revenue: undefined, shipping: undefined, tax: undefined}

Now, admittedly analytics and GTM is not my forte, but do you know why this would be happening? Should I be sending the event as part of a lifecycle hook?

To try and specify my situation, our store is built in a Vue frontend, but the checkout is using Magento, so the user flow is to go from Vue -> Magento -> back to Vue for the order success page. Like I say I am able to construct the object, but it doesn't seem to be passing to the data layer correctly.

michaelsmedley commented 4 years ago

Closing this issue as it turned out to be a configuration with our GTM setup

Thanks for your time