For the record the project that I was working on forked the GAPlugin and added e-commerce tracking for both android and ios, here:
sending e-commerce tracking via phonegap app
-
30-06-2023 - |
Pregunta
i am trying to send e-commerce tracking (Universal Analytics) info from a phonegap app.
I have got the gaplugin working, sending event tracking, but the plugin doesn't support ecommerce tracking
So I've got it working pluginless for events, but it doesn't seem to work for e-commerce tracking.
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '1234',
// Transaction ID. Required.
'affiliation': 'Acme Clothing',
// Affiliation or store name.
'revenue': '11.99',
// Grand Total.
'shipping': '5',
// Shipping.
'tax': '1.29',
// Tax.
'currency': 'EUR'
});
ga('ecommerce:send');
is the code I am using
cheers
Solución 2
Otros consejos
It appears you're missing the ecommerce:addItem
command:
// loads ecommerce plugin
ga('require', 'ecommerce', 'ecommerce.js');
// adds transaction data
ga('ecommerce:addTransaction', {
'id': '1234', // Transaction ID. Required.
'affiliation': 'Acme Clothing', // Affiliation or store name.
'revenue': '11.99', // Grand Total.
'shipping': '5', // Shipping.
'tax': '1.29' // Tax.
});
// adds item data
ga('ecommerce:addItem', {
'id': '1234', // Transaction ID. Required.
'name': 'Fluffy Pink Bunnies', // Product name. Required.
'sku': 'DD23444', // SKU/code.
'category': 'Party Toys', // Category or variation.
'price': '11.99', // Unit price.
'quantity': '1' // Quantity.
});
// sends transaction
ga('ecommerce:send');
More info in Google's documentation : Ecommerce Tracking - Web Tracking (analytics.js)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow