I have this javascript code for google analytics;
<script>
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '3417327',
'affiliation': '',
'revenue': '59.90',
'shipping': '99.00',
'tax': '0'
});
ga('ecommerce:addItem', {
'id': '3417327',
'name': 'Sample',
'sku': '86454',
'category': '',
'price': '59.90',
'quantity': '1'
});
ga('ecommerce:send');
</script>
Please note that I can not modify the above code at all. Its is a template section that is hard coded, and I will be adding the required code in the footer section to get the output.
What I need is to use javascript or jquery to read the values of id, name, sku, affliation, revenue all and print it say in console.log. I tried by best to get some code but it all failed for me.
Can anyone help me I will highly appreciate