将谷歌分析商务跟踪中的交易添加到“待处理”状态

时间:2015-01-06 15:34:56

标签: google-analytics

我在尝试找出如何在“待定”的Google Analytics跟踪中添加交易时遇到问题。模式,并将其更改为'付费'只有在客户完成付款时才会这样。问题是我手动向客户收费,并在我收取费用后添加交易会插入我购买的详细信息:操作系统,国家/地区,网站活动等。所以我需要定期添加GA JS交易,但请将其标记为稍后付款。我在GA文档中没有发现任何这方面的内容。任何想法?

干杯, DOR。

1 个答案:

答案 0 :(得分:0)

尝试使用Enchanced Ecommerce actions。您可以将“待处理”状态设置为结帐步骤。如果您想要将交易模式更改为您自己的“付费”,则可能会出现问题。有可能为结帐步骤设置交易ID,但我从未尝试过它是否正常工作,以及是否与同一交易ID的进一步购买相匹配。试试这个

基于GA帮助的示例:

<script>
ga('create', 'UA-XXXXX-Y');
ga('require', 'ec');

ga('ec:addProduct', {               // Provide product details in an productFieldObject.
  'id': 'P12345',                   // Product ID (string).
  'name': 'Android Warhol T-Shirt', // Product name (string).
  'category': 'Apparel',            // Product category (string).
  'brand': 'Google',                // Product brand (string).
  'variant': 'black',               // Product variant (string).
  'price': '29.20',                 // Product price (currency).
  'quantity': 1                     // Product quantity (number).
});

// Add the step number and additional info about the checkout to the action.
ga('ec:setAction','checkout', {
  'id': 'T123456'
  'step': 4,                       // Let it be your last step
  'option': 'Pending'
});

ga('send', 'pageview');
</script> 

然后,在您手动关闭交易后,您只需要致电:

<script>
ga('create', 'UA-XXXXX-Y');
ga('require', 'ec');

ga('ec:addProduct', {               // Provide product details in an productFieldObject.
  'id': 'P12345',                   // Product ID (string).
  'name': 'Android Warhol T-Shirt', // Product name (string).
  'category': 'Apparel',            // Product category (string).
  'brand': 'Google',                // Product brand (string).
  'variant': 'black',               // Product variant (string).
  'price': '29.20',                 // Product price (currency).
  'quantity': 1                     // Product quantity (number).
});

// Transaction level information is provided via an actionFieldObject.
ga('ec:setAction', 'purchase', {
  'id': 'T12345',
  'affiliation': 'Google Store - Online',
  'revenue': '37.39',
  'tax': '2.85',
  'shipping': '5.34',
  'coupon': 'SUMMER2013'    // User added a coupon at checkout.
});

ga('send', 'pageview');    
</script>

编辑:

还有一件事。如果我理解正确,您将在没有用户交互的情况下关闭交易,您还需要指定其客户ID(在本例中为来自GA的ID)以确保此交易与之前的结账相匹配。首先,您需要将GA ID与所有交易信息一起保存到CMS中。要从ga中提取你只需要打电话(根据GA帮助)

ga(function(tracker) {
  var clientId = tracker.get('clientId');
});

之后,如果您要发送结算购买操作,则需要在GA创建调用中手动定义客户ID。

ga('create', 'UA-XXXX-Y', {
  'clientId': '35009a79-1a05-49d7-b876-2b884d0f825b' // Stored cid from your CMS
});

拥有所有这些,您现在应该完成关闭GA内部跟踪交易的全部流程。

PS。

如果我理解您的情况,您希望从系统发送结束购买。为此,您需要从此示例中取最后一步,并使用Measurement Protocol将其编码为单个url调用。关于它的更多信息here

相关问题