Jump to content

Google Analytics Questions with complete.tpl


Recommended Posts

Hello

 

I have the following integration code from GA

 

<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">
var pageTracker = _gat._getTracker("UA-xxxxx-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

 

this i have integrated in to my website and template on WHMCS for tracking.

 

What code do I enter in to the tracking area on /orderforms/cart/complete.tpl

 

i assume they should be some other code on google for updating the ecommerce side. I have looked around GA and couldn't find anything obvious.

Link to comment
Share on other sites

I have since found this. for those also looking try:

 


<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>

<script type="text/javascript">
 var pageTracker = _gat._getTracker("UA-XXXXX-1");
 pageTracker._initData();

 pageTracker._addTrans(
   "$OrderID",                                     // Order ID
   "$amount",                                    // Total
   "$tax",                                     // Tax
   "$ClientID",                                 // Client ID
   "$Country"                                       // Country
 );

 pageTracker._addItem(
   "$OrderID",                                     // Order ID
   "$Products",                                  // Product Name 
   "$amount",                                    // Price
 );

 pageTracker._trackTrans();
</script>

Link to comment
Share on other sites

Add it like this:

 



{literal}
<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">
var pageTracker = _gat._getTracker("UA-xxxxx-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
{/literal}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated