Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

X-Payments with Google Analytics Conversion Code

 
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions
 
Thread Tools
  #11  
Old 01-06-2015, 12:34 AM
  ambal's Avatar 
ambal ambal is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 4,119
 

Default Re: X-Payments with Google Analytics Conversion Code

The solution from the forum actually works in your store. However, the tracking code was not displayed because of the templates cache. We've cleaned the cache up, and as far as we can see, now the Google Analytics, BazaarVoice and some other tracking code is included into the invoice page correctly. Please check it from your side.

You may find the information regarding the X-Cart templates cache here: http://help.x-cart.com/index.php?title=X-Cart:Advanced_Tools#Clear_Templates.2FX-Cart_Cache
__________________
Sincerely yours,
Alex Mulin
VP of Business Development for X-Cart
X-Payments product manager
Reply With Quote
  #12  
Old 01-30-2015, 08:28 AM
  mcanitano's Avatar 
mcanitano mcanitano is offline
 

eXpert
  
Join Date: Feb 2006
Location: Melbourne, FL
Posts: 216
 

Default Re: X-Payments with Google Analytics Conversion Code

We had this same issue, and removed the ga_track_commerce eq "y" in the {if} statement in ga_code_async.tpl. (put it in //comments so we still have the original code)

See our code below, we're 99% sure it's working as it should

Code:
<script type="text/javascript"> (function(i,s,o,g,r,a,m){ldelim}i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ldelim} (i[r].q=i[r].q||[]).push(arguments){rdelim},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) {rdelim})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', '{$config.Google_Analytics.ganalytics_code}'); // Analytics Property ID ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview'); {if $config.Google_Analytics.ganalytics_e_commerce_analysis eq "Y" and $main eq "order_message" and $orders } // and $ga_track_commerce eq "Y" // Ecommerce Tracking for order_message page ga('require', 'ecommerce'); // Load the ecommerce plug-in. ga('require', 'ecommerce', 'ecommerce.js'); {foreach from=$orders item="order"} ga('ecommerce:addTransaction', {ldelim} 'id': '{$order.order.orderid}', // Transaction ID. Required 'revenue': '{$order.order.total}', // Grand Total {if $order.order.shipping_cost gt 0}'shipping': '{$order.order.shipping_cost}'{else}'shipping': '0'{/if}, // Shipping {if $order.order.tax gt 0}'tax': '{$order.order.tax}',{/if} // Tax 'affiliation': '{$partner|default:'SilverHorse Racing'}' // Affiliation or store name {rdelim}); {foreach from=$order.products item="product"} ga('ecommerce:addItem', {ldelim} 'id': '{$order.order.orderid}', // Transaction ID. Required. 'name': '{$product.product|wm_remove|escape:javascript}{if $active_modules.Product_Options ne "" and $product.product_options_txt} ({$product.product_options_txt|replace:"\n":", "|wm_remove|escape:javascript}){/if}', // Product name. Required. 'sku': '{$product.productcode|wm_remove|escape:javascript}', // SKU/code. 'category': '{$product.category|default:'Unknown category'}', // Category or variation. 'price': '{$product.price}', // Unit price. 'quantity': '{$product.amount}' // Quantity. {rdelim}); {/foreach} {/foreach} ga('ecommerce:send'); //submits transaction to the Analytics servers {/if} </script> {if $active_modules.Google_Checkout ne ""} <script src="{if $current_location eq $http_location}http{else}https{/if}://checkout.google.com/files/digital/ga_post.js" type="text/javascript"></script> {/if}
__________________
Marcello Canitano
New Site: X-Cart v4.5.5 GOLD
X-Cart Mobile v1.4.3
X-Payments v1.0.6
CDSEO Pro v2
Total Server Solutions xCDN

www.silverhorseracing.com
Reply With Quote
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:10 AM.

   

 
X-Cart forums © 2001-2020