0
votes

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

1

1 Answers

0
votes

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