Reputation: 167
We have implemented the google analytics ecommerce tracking: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
The standard ecommerce tracking gives us the options to send the following data to analytics from our "order complete" page:
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.
});
And for each item in the transaction:
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.
});
We also want to send the profit/margin for each transaction/item. To solve this we have used custom metrics. So now our ecommerce tracking script looks like this:
<script type="text/javascript">
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '1078163', // Transaction ID. Required.
'affiliation': 'www.website.com', // Affiliation or store name.
'revenue': '138' // Grand Total.
});
//Dimension
var dimensionValue = 'www.website.com';
ga('set', 'dimension1', dimensionValue);
//Revenue
var metricValue = '138';
ga('set', 'metric1', metricValue);
//Profit:
var metricValue = '55';
ga('set', 'metric2', metricValue);
ga('ecommerce:addItem', {
'id': '1078163',
'name': 'F-91W',
'sku': 'F-91W',
'category': 'Casio Watches',
'price': '138',
'quantity': '1'
}); ga('ecommerce:addItem', {
'id': '1078163',
'name': 'Fragt2-FI',
'sku': 'Fragt2-FI',
'Category': 'Fragt',
'price': '0',
'quantity': '1'
});
ga('ecommerce:send');
</script>
This implementation gives us the opportunity to see the profit for specific days/channels etc. But we have two concerns. First of all the data collected in our custom report are incorrect. Second, we would like to have the profit as a dimension in the standard ecommerce report. Any idea if this is possible?
The custom metrics are set up with scope=hit, and formatting type=currency.
NB. we want the profit to show direcly in the code even though competitors could utilize this.
Upvotes: 0
Views: 373
Reputation: 1019
Upvotes: 0