Developer forum

Forum » Ecommerce - Standard features » Google analytics eCommerce tracking

Google analytics eCommerce tracking

Per Søgaard
Reply

I have set up Google analytics tracking on the eCom receipt page.

The Google script sends orderinformation and prices to analytics and it works.

Problem is that prices are output with danish separators like 12.111,00 and Google only understands american format 12,111.00 which means that the price is registered as 12.

I need a tag or extension or ? that formats all prices and numbers like Google wants it.

 

<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol ) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
  var pageTracker = _gat._getTracker("UA-xxxxxxxxx-1");
  pageTracker._trackPageview();
	pageTracker._addTrans(
	"<!--@Ecom:Order.ID-->",
	"<!--@Ecom:Order.ShopID-->",
	"<!--@Ecom:Order.Price.PriceWithoutVAT-->",
	"<!--@Ecom:Order.Price.VAT-->",
	"<!--@Ecom:Order.ShippingFee.Price-->",
	"<!--@Ecom:Order.Customer.City-->",
	"<!--@Ecom:Order.Customer.Country-->"
	);
	  <!--@LoopStart(OrderLines)-->
	pageTracker._addItem(
	"<!--@Ecom:Order:OrderLine.OrderID-->",
	"<!--@Ecom:Order:OrderLine.ProductID-->",
	"<!--@Ecom:Order:OrderLine.ProductName-->",
	"<!--@LoopStart(AssociatedGroups)--><!--@Ecom:Group.Name-->,<!--@LoopEnd(AssociatedGroups)-->",
	"<!--@Ecom:Order:OrderLine.UnitPrice.PriceWithoutVAT-->",
	"<!--@Ecom:Order:OrderLine.Quantity-->"
	);
	<!--@LoopEnd(OrderLines)-->
   pageTracker._trackTrans(); //submits transaction to the Analytics servers
} catch(err) {}
</script>

 


Replies

 
Nicolai Høeg Pedersen
Reply

Seems like there is some missing text.

 

Could you repost the question? Or have you figured it out?

 

We also have a blog post on the subject here: http://mri.developer.dynamicweb-cms.com/blog/2012/10/setting-up-a-google-analytics-goal-funnel-with-dynamicweb-cart-v2.aspx

 
Per Søgaard
Reply

Sorry.

I updated the post above.

BR Per

 
Nicolai Høeg Pedersen
Reply

Have a look at the Price tag extensions:

http://templates.dynamicweb-cms.com/eCommerce/Dynamicweb-eCommerce-template-tags/Extentions/Price-tag-extensions.aspx

And the blog post above...

 

BR Nicolai

 
Per Søgaard
Reply

Hi Nicolai

The post by Mikkel is about funneling and not the same as above and does not handle the above problem with formatting of prices.

I have already looket at the page with page extensions but there is nothing about formatting the prices in american format (and danish on the webpage).


BR Per

 
Nicolai Høeg Pedersen
Reply

Hi Per

 

Sorry - did not notice the difference.

 

According to GA documentation (https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce) the first instance of . or , is the comma seperator - and you have both causing the confusion.

 

So you have three options

BR Nicolai

 

 
Per Søgaard
Reply

Thanks a lot Nicolai.

BR Per Søgaard

 

You must be logged in to post in the forum