向Google Analytics分析事务添加自定义指标

时间:2015-07-28 07:45:32

标签: google-analytics transactions

我正在尝试向Google Analytics上的交易添加自定义指标。它必须是每笔交易。目前我正在添加这样的交易。

    ga('ecommerce:addTransaction', {
        'id':           '',
        'affiliation':  '',
        'revenue':      '',
        'tax':          '',
        'currency':     ''
    });
    ga('ecommerce:addItem', {
        'id':       '',
        'name':     '',
        'sku':      '',
        'category': '',
        'price':    '',
        'currency': '',
        'quantity': ''
    });

现在我的想法是在交易中添加以下内容,但不知道它是否是正确的方法。

ga('ecommerce:addProduct', {'metric1': hasTransacted});

我知道页面视图可以将自定义指标添加到页面视图中,就像这样

ga('set', 'metric1', '1');

ga('send', 'pageview');

但我试图将其添加到交易中。

非常感谢任何建议。

1 个答案:

答案 0 :(得分:0)

您应该能够将指标添加到事务匹配中,就像使用addProduct的示例一样。这是一个类似的问题is it possible to send custom variables to Google analytics while using ecommerce extension