Start a conversation

Adding Google Analytics E-commerce tracking to your store

To add new Google Analytics tracking to your store

1) upload file called "google_analytics.tpl" to skin1 folder of your x-cart installation (you can find this file in Downloads section of this support board). Do not forget to replace 2 instances of "UA-XXXXXX-1" to your Google Analytics ID in that file.

2) add this code in customer/home.tpl just before closing BODY tag:

{if $smarty.get.mode ne "order_message"}
{include file="google_analytics.tpl"}
{/if}

3) in customer/main/order_message.tpl right after this code:

{if $active_modules.Interneka ne ""}
{ include file="modules/Interneka/interneka_tags.tpl" }
{/if}

add:

{*** Google Analytics conversion tracking ***}
{include file="google_analytics.tpl" products=$orders[oi].products order=$orders[oi].order}

All done. You should see ecommerce conversion data in your Google Analytics account in 24-48 hours.

Please let us know your comments or if you need help adding this code to your store.
Special thank you to our clients who helped to test and refine this code.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Anton Pachkine

  2. Posted
  3. Updated

Comments