Vue.use(VueAnalytics, {
id: process.env.googleAnalyticsID,
router,
ecommerce: {
enabled: true,
enhanced: false,
},
debug:{
enabled: true,
sendHitTask: true
}
});
`this.$ga.ecommerce.addTransaction({
id: this.id,
revenue: "37.39",
currency: "NZD",
});
this.$ga.ecommerce.addItem([{
name: "ClassCode - Description", // Product name. Required.
category: "Vehicle",
id: this.id, // Booking ID. Required.
price: "11.99", // Unit price.
days: "4", // HirePeriodInDays
quantity: "1", // Quantity.
currency: "NZD",
}]);
this.$ga.ecommerce.addItem({
name: "Peace of Mind", // Product name. Required.
category: "Insurance",
id: this.id, // Booking ID. Required.
price: "5.00", // Unit price.
quantity: "1", // Quantity.
currency: "NZD",
});
this.$ga.ecommerce.addItem({
name: "Afterhours Pick up", // Product name. Required.
category: "Other Fees",
id: this.id, // Booking ID. Required.
price: "5.00", // Unit price.
quantity: "1", // Quantity.
currency: "NZD",
});
this.$ga.ecommerce.addItem({
name: "OneWay Fee", // Product name. Required.
category: "Other Fees",
id: this.id, // Booking ID. Required.
price: "5.00", // Unit price.
quantity: "1", // Quantity.
currency: "NZD",
});
this.$ga.ecommerce.addItem({
name: "Airport Concession Fee", // Product name. Required.
category: "Other Fees",
id: this.id, // Booking ID. Required.
price: "5.00", // Unit price.
quantity: "1", // Quantity.
currency: "NZD",
});
this.$ga.ecommerce.addItem({
name: "Accessory name", // Product name. Required.
category: "Accessory",
id: this.id, // Booking ID. Required.
price: "5.00", // Unit price.
quantity: "1", // Quantity.
currency: "NZD",
});
this.$ga.ecommerce.send();`
I can see the collect request going through but only the transaction and last item is in there, I can get it working if I do a send() after adding each item but I doubt that's correct.
I have also tried passing in an array of items which was unsuccessful, and the addProduct function is not available in the non enhanced version. What is the correct way of handling this, or is it a bug?