Javascript Google Analytics多跟踪订单无法完全正常工作

Javascript Google Analytics多跟踪订单无法完全正常工作,javascript,google-analytics,Javascript,Google Analytics,我有这样的谷歌分析代码。这是客户端浏览器上查看页面源代码的结果示例,而不是JSP代码。首先创建对象并发送页面视图 ga('create', 'UA-11111111-1', 'auto'); ga('send', 'pageview'); ga('create', 'UA-11111111-2', 'auto', {'name': 'Rollup'}); ga('Rollup.send', 'pageview'); ga('create', 'UA-11111111-3', 'auto', {'

我有这样的谷歌分析代码。这是客户端浏览器上查看页面源代码的结果示例,而不是JSP代码。首先创建对象并发送页面视图

ga('create', 'UA-11111111-1', 'auto');
ga('send', 'pageview');
ga('create', 'UA-11111111-2', 'auto', {'name': 'Rollup'});
ga('Rollup.send', 'pageview');
ga('create', 'UA-11111111-3', 'auto', {'name': 'AnotherRollup'});
ga('AnotherRollup.send', 'pageview');
这很好用。我的意思是,我可以在google analytics上看到这三个账户的所有实时页面浏览量。然后按照添加事务代码进行操作

ga('require', 'ecommerce');

// create transaction object
var Transaction = {
  'id': '12345', // transaction ID
  'affiliation': 'North East Store',
  'revenue': 100.00',
  'shipping': '0.00',
  'tax': '0.00'
};

// add transaction to all the trackers
ga('ecommerce:addTransaction', Transaction);
ga('Rollup.ecommerce:addTransaction', Transaction);
ga('AnotherRollup.ecommerce:addTransaction', Transaction);
然后按照代码将项目添加到事务中

var Item = {}; // this is to prepare the var for multi items.

Item = {
    'id': '12345',         // transaction ID
    'name': 'Microwave',   // name
    'sku': '111',          // SKU/code.
    'category': 'Kitchen', // Category or variation.
    'price': '20.00',      // Unit price.
    'quantity': '5'        // Quantity.
};

ga('ecommerce:addItem', Item);
ga('RollUp.ecommerce:addItem', Item);
ga('AnotherRollUp.ecommerce:addItem', Item);
然后按照代码将所有这些订单发送到google analytics

//submits transaction to the Analytics servers
ga('ecommerce:send');
ga('Rollup.ecommerce:send'); 
ga('AnotherRollup.ecommerce:send');
问题是,该订单仅在google analytics上接收/更新第一个帐户(在本javascript代码案例中为未命名/默认)。我认为这是因为我对另外两个使用了错误的谷歌分析追踪账户代码。但我已经重新检查了,另外两个跟踪器帐户代码是正确的,我可以实时查看页面视图。所以那一定不是因为那个。我的来源是:


我已经检查了所有的东西,根据手册,一切都是正确的。但我仍然无法获得其他两个跟踪程序(Rollup和另一个Rollup)的结果。我的代码有什么问题吗?还是问题出在别的地方?非常感谢。

每次包含电子商务库时,您都需要包含跟踪器名称:

ga('require', 'ecommerce');
ga('RollUp.require', 'ecommerce');
ga('AnotherRollUp.require', 'ecommerce');

这里甚至记录了这一点:

是的,我完全忽略了这一点。非常感谢你!