To complete your community registration, please accept the Google Terms of Service and the Community Guidelines.
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
Guide Me
X
Didn’t find what you were looking for?
Click here to start a new topic
Click here to start a new topic
Highlighted
Analytics ecommerce transactions/products prices show 0$
Visitor ✭ ✭ ✭
I’m having an issue where the transaction and the products in Conversions>Ecommerce have their revenue and tax set to 0 even if i send price data.
In the console the objects are created and have set the correct price.
$trans =" ga('ecommerce:addTransaction', { 'id': '{$oid}', // Transaction ID. Required. 'affiliation': 'My Shop', // Affiliation or store name. 'revenue': '{$totale}', // Grand Total. 'shipping': '{0}', // Shipping. 'tax': '{$tva}', // Tax. 'currency': 'RON' }); "; $items=''; foreach($products as $product){ $items = " ga('ecommerce:addItem', { 'id': '{$oid}', // Transaction ID. Required. 'name': '{$product['name']}', // Product name. Required. 'sku': '{$product['model']}', // SKU/code. 'category': '{$categories_info['name']}', // Category or variation. 'price': '{$product['price']}', // Unit price. 'quantity': '{$product['quantity']}', // Quantity. 'currency': 'RON' }); "; } ?> <script> window.onload = function() { ga('create', 'UA-42377326-1') ga('require', 'ecommerce'); <?php echo $trans;?> <?php echo $items;?> ga('ecommerce:send'); }; </script>
And in console it looks like this:
<script> window.onload = function() { ga('create', 'UA-42377326-1') ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { 'id': '5453', // Transaction ID. Required. 'affiliation': 'My Shop', // Affiliation or store name. 'revenue': '209', // Grand Total. 'shipping': '{0}', // Shipping. 'tax': '39.71', // Tax. 'currency': 'LEU' }); ga('ecommerce:addItem', { 'id': '5453', // Transaction ID. Required. 'name': 'The best product', // Product name. Required. 'sku': 'drr1563', // SKU/code. 'category': 'PRODUSE', // Category or variation. 'price': '130', // Unit price. 'quantity': '1', // Quantity. 'currency': 'LEU' }); ga('ecommerce:send'); }; </script>
Leave a Reply