Tracking currency with google analytics universal

I'm having trouble tracking currencies correctly in google analytics using their newer universal protocol. Our web store takes purchases in £,$ and €.

According to google analytics docs here I can specify the currency globally, for the transaction or as finely grained at the items in the transaction. I have tried all three methods separately and together. In all cases, my trasaction is tracked in analytics with all data correct accept the currency which is tracked as "(Not set)".

Here is a link to the api docs google provide:

https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

Here is the tracking code that is executed:

 jQuery(function($){
   ga("require", "ecommerce", "ecommerce.js");

   ga("set", "currencyCode", "USD");

   ga("ecommerce:addTransaction", {
      "id": "WP19299MQBPIM",
      "affiliation": "Online Store",
      "revenue": "50",
      "shipping": "0",
      "vat": "0",
      "currencyCode": "USD"
   });

   ga("ecommerce:addItem", {
      "id": "WP19299MQBPIM",
      "name": "Product 1",
      "sku": "com.beaumont.teaching.product1",
      "price": "50",
      "quantity": "1",
      "currencyCode": "USD"
   });

   ga("ecommerce:send");
 });

Any ideas as to what I could change to get this to track correctly?

Thanks!

Ben


I posted on google's forums and they just got back to me. Their documentation is slightly wrong. We should be using:

'currency'

instead of:

'currencyCode'

I hope that helps.

Ben

链接地址: http://www.djcxy.com/p/81332.html

上一篇: 如何跟踪用户ID带Google Analytics并在登录后不重新加载页面?

下一篇: 跟踪谷歌分析通用的货币