Im trying to add custom metrics to transactions on google analytics. It must be per transaction. Currently I'm adding transactions like this.
ga('ecommerce:addTransaction', {
'id': '',
'affiliation': '',
'revenue': '',
'tax': '',
'currency': ''
});
ga('ecommerce:addItem', {
'id': '',
'name': '',
'sku': '',
'category': '',
'price': '',
'currency': '',
'quantity': ''
});
Now what I was thinking was adding the following to the transaction but don't quite know if its the right way to do it.
ga('ecommerce:addProduct', {'metric1': hasTransacted});
I know with page views custom metrics can be added to page view like this
ga('set', 'metric1', '1');
ga('send', 'pageview');
But Im trying to add it to a transaction instead.
Any advice would be greatly appreciated.