Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Guest

Google Analytics module

Recommended Posts

I'm getting this error on checkout_success.php

 

Warning: main(includes/footer-tracker.php) [function.main]: failed to open stream: No such file or directory in /home/src/public_html/shop/checkout_success.php on line 167

 

Warning: main(includes/footer-tracker.php) [function.main]: failed to open stream: No such file or directory in /home/src/public_html/shop/checkout_success.php on line 167

 

Warning: main(includes/footer-tracker.php) [function.main]: failed to open stream: No such file or directory in /home/src/public_html/shop/checkout_success.php on line 167

 

Fatal error: main() [function.require]: Failed opening required 'includes/footer-tracker.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/src/public_html/shop/checkout_success.php on line 167

 

Can anyone help me?

Share this post


Link to post
Share on other sites
Guest
Am I the only one that uses this module and also accepts paypal?

If you take paypal and use the analytics module, your analytics figures are NOT correct.

If you have a fix for this, PM me, I'll pay for a fix for this.

 

It drives me nuts that I can't look at the google analytics ecommerce figures are not correct.

 

I do use PP and GA and will take a look at this. Could you be more specific? transactions are all missing, just some, what is the problem exactly?

Share this post


Link to post
Share on other sites
I do use PP and GA and will take a look at this. Could you be more specific? transactions are all missing, just some, what is the problem exactly?

 

they only show in GA if the user clicks the paypal button that says return to the shopping cart. Then they go to the checkout_success.php page. They do not have to do this though. Their order is still valid even if they don't return to this page on your website. If they just quit after filling out the paypal side of the order, you get NO transaction on the GA side.

 

Like you, I get a few paypal transactions that show up in the GA results but many do not.

Share this post


Link to post
Share on other sites
I am using this contribution, but I am getting the following at the top of my checkout_success.php page:

 

pageTracker._addTrans( "5"," ","72.45","","5.45","Shelby Twp.","Michigan","United States" ); pageTracker._addItem( "5","29","Long Sleeve T-Shirt (Grey)","T-Shirts","17.00","1""5","35","MS Movement Bracelet","Bracelets","20.00","1""5","40","MS Movement Markers","Pens","30.00","1" ); pageTracker._trackTrans();

 

I can't seem to figure out why this is happening, either.

 

Here is the code I have in my checkout_success.php page:

 

<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-XXXXXX-");
	pageTracker._initData();
	pageTracker._trackPageview();

	<?php 
		include(DIR_WS_MODULES . 'analytics/analytics.php'); 
	?>

</script>

I get this exact same error any suggestions?

Share this post


Link to post
Share on other sites
For anyone who may be trying to install google analytics V2 with STS, give this a try. I just figured it out and thought I'd share. I modified the instructions from arnoldl

 

A SHORT INSTRUCTION FOR GOOGLE ANALYTICS E-COMMERCE WITH STS4

 

1 - install the google analytics files from the package as discribed.

2 - in checkout_success.php add just before :

 

<?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>
   </table></form></td>
<!-- body_text_eof //-->

 

Add this code:

<?php
//google analytics
     require(DIR_WS_MODULES . 'analytics/analytics.php')?>

 

3 - in your template file (like includes/sts_templates/test/sts_template.html ) add just after :

 

<!--$headcontent-->

 

Add this code:

<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-xxxxxxx-x");
	pageTracker._initData();
	pageTracker._trackPageview();
</script>

4 - don't forget to place this in every template file if you have more

 

5 - change the xxxxx-x to your ua- code from google

 

6 - don't thank me , thank the maker of the google analytics module and arnoldl :)

 

Hope this helps

Are the changes to checkout_success instead of or as well as the changes in the contribution. I've done it as well as but I'm getting the following error and wonder if this is why:

 

pageTracker._addTrans( "70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom" ); pageTracker._addItem( "70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1"); pageTracker._trackTrans();

 

Many thanks

Share this post


Link to post
Share on other sites
Guest
Are the changes to checkout_success instead of or as well as the changes in the contribution. I've done it as well as but I'm getting the following error and wonder if this is why:

 

pageTracker._addTrans( "70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom" ); pageTracker._addItem( "70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1"); pageTracker._trackTrans();

 

Many thanks

 

 

could you post a "view source" from your browser OF THE RENDERED HTML of your checkout_success page (NOT THE PHP CODE)

Share this post


Link to post
Share on other sites
could you post a "view source" from your browser OF THE RENDERED HTML of your checkout_success page (NOT THE PHP CODE)

 

Sure, thanks:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mydomain :</title>
<meta name="robots" content="noodp" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- EOF: Generated Meta Tags -->

<base href="https://mydomain.co.uk/shop/">

<!-- start get_javascript(applicationtop2header) //-->
<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-4787663-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>		


pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");


pageTracker._trackTrans();



</script>
<!-- end get_javascript(applicationtop2header) //-->

<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-4787663-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<table border="0" width="80%" cellspacing="0" align="center" cellpadding="0">
<tr class="header">
	<td valign="middle">
	   <img border="0" src="images/headerlogo.jpg" width="100%" height="190" >
	<td align=right>
		<a href="https://mydomain.co.uk/shop/account.php"></a>
		<a href="https://mydomain.co.uk/shop/shopping_cart.php"></a>
		<a href="https://mydomain.co.uk/shop/checkout_shipping.php"></a>		</td>
</tr>
</table>

<table border="0" width="80%" cellspacing="0" align="center" cellpadding="1">
<tr class="headerNavigation">
	<td class="headerNavigation">
		  
		<a href="http://rmydomain.co.uk" class="headerNavigation">Top</a> » <a href="http://mydomain.co.uk/shop/index.php" class="headerNavigation">Catalog</a> » Checkout » Success
	</td>
	<td align="right" class="headerNavigation">
		 <a href="http://www.mydomain.co.uk">Home</a> | <a href=https://mydomain.co.uk/shop/account.php class="headerNavigation">My Account</a> | <a href=https://mydomain.co.uk/shop/logoff.php class="headerNavigation">Log Off</a> | <a href=https://mydomain.co.uk/shop/shopping_cart.php class="headerNavigation">Bag Contents</a> | <a href=https://mydomain.co.uk/shop/checkout_shipping.php class="headerNavigation">Checkout</a>
		  
	</td>
</tr>
</table>

<table width="80%" border="0" align="center" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF">
 <tr>
<td valign="top" width="125">
  <table border="0" width="125" cellspacing="0" cellpadding="2">
	<tr><td>
<!-- Start Category Menu -->
<form name="goto" action="index.php" method="get"><select name="cPath" onChange="this.form.submit();"><option value="0">Catalog</option><option value="21">Acoustic Guitars</option><option value="24">Classical Guitars</option><option value="29">Electric Guitars</option></select></form>
<!-- End Category Menu -->
</td></tr>
	<tr><td>
<!-- start categorybox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Categories</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td align="left" class="boxText"><div id="thecategories"><div id="topcat"><a href="http://mydomain.co.uk/shop/acousticguitars-c-21.html"><span class="catwithsubs"><img src="images/categories/arrow_right.gif" border="0" alt="" width="9" height="9"></span>Acoustic Guitars</a></div><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><br><img src="images/pixel_ltgray.gif" border="0" alt="" width="100%" height="1"><br><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><div id="topcat"><a href="http://mydomain.co.uk/shop/classicalguitars-c-24.html"><span class="catwithsubs"><img src="images/categories/arrow_right.gif" border="0" alt="" width="9" height="9"></span>Classical Guitars</a></div><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><br><img src="images/pixel_ltgray.gif" border="0" alt="" width="100%" height="1"><br><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><div id="topcat"><a href="http://mydomainco.uk/shop/electricguitars-c-29.html"><span class="catwithsubs"><img src="images/categories/arrow_right.gif" border="0" alt="" width="9" height="9"></span>Electric Guitars</a></div></div></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end categorybox //-->
</td></tr>
	<tr><td>
<!-- start specialbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Specials</td>
<td height="14" class="infoBoxHeading" nowrap><a href="http://mydomain.co.uk/shop/specials.php"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td align="center" class="boxText"><a href="http://mydomain.co.uk/shop/acousticdreadnoughtstyleguitar-p-53.html"><img src="images/RA-1_main_image.jpg" border="0" alt="Acoustic Dreadnought style guitar" title=" Acoustic Dreadnought style guitar " width="146" height="150"></a><br><a href="http://mydomain.co.uk/shop/acousticdreadnoughtstyleguitar-p-53.html">Acoustic Dreadnought style guitar</a><br><s>£159.99</s><br><span class="productSpecialPrice">£127.99</span></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end specialbox //-->
</td>
	</tr>
	<tr><td>
<!-- start searchbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Quick Find</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td align="center" class="boxText"><form name="quick_find" action="http://mydomain.co.uk/shop/advanced_search_result.php" method="get"><input type="text" name="keywords" size="10" maxlength="30" style="width: 95px"> <input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="Quick Find" title=" Quick Find "><br>Use keywords to find the product you are looking for.<br><a href="http://mydomain.co.uk/shop/advanced_search.php"><b>Advanced Search</b></a></form></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end searchbox //-->
</td>
	</tr>
	<tr><td>
<!-- start informationbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Information</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td class="boxText"><a href="http://mydomain.co.uk/shop/shipping.php">Shipping & Returns</a><br><a href="http://mydomain.co.uk/shop/privacy.php">Privacy Notice</a><br><a href="http://mydomain.co.uk/shop/featured_products.php">Featured Products</a><br><a href="http://rmydomain.co.uk/shop/pdf_catalogue_info.php">Downloadable catalog</a><br><a href="http://mydomain.co.uk/shop/conditions.php">Conditions of Use</a><br><a href="http://mydomain.co.uk/shop/contact_us.php">Contact Us</a><br><a href="http://rmydomain.co.uk/shop/dynamic_sitemap.php">Site Map</a></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end informationbox //-->
</td>
	</tr>
	<tr><td>
<!-- start cartbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Shopping Bag</td>
<td height="14" class="infoBoxHeading" nowrap><a href="http://mydomainshop/shopping_cart.php"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a><img src="images/infobox/corner_right.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td class="boxText">0 items</td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end cartbox //-->
</td>
	</tr>
	<tr><td> </td>
	</tr>
  </table>	</td>
<td valign="top">
  <p>
<!-- start Default Content //-->
<form name="order" action="https://mydomain.co.uk/shop/checkout_success.php?action=update" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="4" cellpadding="2">
	  <tr>
		<td valign="top"><img src="images/table_background_man_on_board.gif" border="0" alt="Your Order Has Been Processed!" title=" Your Order Has Been Processed! " width="1" height="1"></td>
		<td valign="top" class="main"><img src="images/pixel_trans.gif" border="0" alt="" width="1" height="10"><div align="center" class="pageHeading">Your Order Has Been Processed!</div><br>Your order has been successfully processed! Your products will arrive at their destination within 2-5 working days.<br><br>
Please notify me of updates to the products I have selected below:<br><p class="productsNotifications"><input type="checkbox" name="notify[]" value="53"> Acoustic Dreadnought style guitar<br></p>			<h3>Thanks for shopping with us online!</h3></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
  </tr>
  <tr>
	<td align="right" class="main"><input type="image" src="includes/languages/english/images/buttons/button_continue.gif" border="0" alt="Continue" title=" Continue "></td>
  </tr>
  <tr>
	<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%" align="right"><img src="images/pixel_silver.gif" border="0" alt="" width="1" height="5"></td>
			<td width="50%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
		  </tr>
		</table></td>
		<td width="25%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
		<td width="25%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
			<td width="50%"><img src="images/checkout_bullet.gif" border="0" alt="" width="11" height="11"></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td align="center" width="25%" class="checkoutBarFrom">Delivery Information</td>
		<td align="center" width="25%" class="checkoutBarFrom">Payment Information</td>
		<td align="center" width="25%" class="checkoutBarFrom">Confirmation</td>
		<td align="center" width="25%" class="checkoutBarCurrent">Finished!</td>
	  </tr>
	</table></td>
  </tr>

pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");


pageTracker._trackTrans();


</table></form>
<!-- end Default Content //-->
</p>
  <p> </p>	</td>
 </tr>
</table>

<table border="0" width="80%" cellspacing="0" align="center" cellpadding="1">
 <tr class="footer">
<td class="footer">  Saturday 28 June, 2008  </td>
<td align="right" class="footer"><span class="smallText">Copyright © 2008 <a href="http://mydomain.co.uk/shop/index.php">Name</a><br>Designed By <a href="http://www.mydomain.co.uk"target="_blank"></a> </span></td>
 </tr>
</table>

<br>
<br>
</body>
</html>

Share this post


Link to post
Share on other sites
Sure, thanks:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mydomain :</title>
<meta name="robots" content="noodp" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- EOF: Generated Meta Tags -->

<base href="https://mydomain.co.uk/shop/">

<!-- start get_javascript(applicationtop2header) //-->
<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-4787663-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>		


pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");


pageTracker._trackTrans();



</script>
<!-- end get_javascript(applicationtop2header) //-->

<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-4787663-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<table border="0" width="80%" cellspacing="0" align="center" cellpadding="0">
<tr class="header">
	<td valign="middle">
	   <img border="0" src="images/headerlogo.jpg" width="100%" height="190" >
	<td align=right>
		<a href="https://mydomain.co.uk/shop/account.php"></a>
		<a href="https://mydomain.co.uk/shop/shopping_cart.php"></a>
		<a href="https://mydomain.co.uk/shop/checkout_shipping.php"></a>		</td>
</tr>
</table>

<table border="0" width="80%" cellspacing="0" align="center" cellpadding="1">
<tr class="headerNavigation">
	<td class="headerNavigation">
		  
		<a href="http://rmydomain.co.uk" class="headerNavigation">Top</a> » <a href="http://mydomain.co.uk/shop/index.php" class="headerNavigation">Catalog</a> » Checkout » Success
	</td>
	<td align="right" class="headerNavigation">
		 <a href="http://www.mydomain.co.uk">Home</a> | <a href=https://mydomain.co.uk/shop/account.php class="headerNavigation">My Account</a> | <a href=https://mydomain.co.uk/shop/logoff.php class="headerNavigation">Log Off</a> | <a href=https://mydomain.co.uk/shop/shopping_cart.php class="headerNavigation">Bag Contents</a> | <a href=https://mydomain.co.uk/shop/checkout_shipping.php class="headerNavigation">Checkout</a>
		  
	</td>
</tr>
</table>

<table width="80%" border="0" align="center" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF">
 <tr>
<td valign="top" width="125">
  <table border="0" width="125" cellspacing="0" cellpadding="2">
	<tr><td>
<!-- Start Category Menu -->
<form name="goto" action="index.php" method="get"><select name="cPath" onChange="this.form.submit();"><option value="0">Catalog</option><option value="21">Acoustic Guitars</option><option value="24">Classical Guitars</option><option value="29">Electric Guitars</option></select></form>
<!-- End Category Menu -->
</td></tr>
	<tr><td>
<!-- start categorybox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Categories</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td align="left" class="boxText"><div id="thecategories"><div id="topcat"><a href="http://mydomain.co.uk/shop/acousticguitars-c-21.html"><span class="catwithsubs"><img src="images/categories/arrow_right.gif" border="0" alt="" width="9" height="9"></span>Acoustic Guitars</a></div><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><br><img src="images/pixel_ltgray.gif" border="0" alt="" width="100%" height="1"><br><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><div id="topcat"><a href="http://mydomain.co.uk/shop/classicalguitars-c-24.html"><span class="catwithsubs"><img src="images/categories/arrow_right.gif" border="0" alt="" width="9" height="9"></span>Classical Guitars</a></div><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><br><img src="images/pixel_ltgray.gif" border="0" alt="" width="100%" height="1"><br><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="2"><div id="topcat"><a href="http://mydomainco.uk/shop/electricguitars-c-29.html"><span class="catwithsubs"><img src="images/categories/arrow_right.gif" border="0" alt="" width="9" height="9"></span>Electric Guitars</a></div></div></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end categorybox //-->
</td></tr>
	<tr><td>
<!-- start specialbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Specials</td>
<td height="14" class="infoBoxHeading" nowrap><a href="http://mydomain.co.uk/shop/specials.php"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td align="center" class="boxText"><a href="http://mydomain.co.uk/shop/acousticdreadnoughtstyleguitar-p-53.html"><img src="images/RA-1_main_image.jpg" border="0" alt="Acoustic Dreadnought style guitar" title=" Acoustic Dreadnought style guitar " width="146" height="150"></a><br><a href="http://mydomain.co.uk/shop/acousticdreadnoughtstyleguitar-p-53.html">Acoustic Dreadnought style guitar</a><br><s>£159.99</s><br><span class="productSpecialPrice">£127.99</span></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end specialbox //-->
</td>
	</tr>
	<tr><td>
<!-- start searchbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Quick Find</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td align="center" class="boxText"><form name="quick_find" action="http://mydomain.co.uk/shop/advanced_search_result.php" method="get"><input type="text" name="keywords" size="10" maxlength="30" style="width: 95px"> <input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="Quick Find" title=" Quick Find "><br>Use keywords to find the product you are looking for.<br><a href="http://mydomain.co.uk/shop/advanced_search.php"><b>Advanced Search</b></a></form></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end searchbox //-->
</td>
	</tr>
	<tr><td>
<!-- start informationbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Information</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td class="boxText"><a href="http://mydomain.co.uk/shop/shipping.php">Shipping & Returns</a><br><a href="http://mydomain.co.uk/shop/privacy.php">Privacy Notice</a><br><a href="http://mydomain.co.uk/shop/featured_products.php">Featured Products</a><br><a href="http://rmydomain.co.uk/shop/pdf_catalogue_info.php">Downloadable catalog</a><br><a href="http://mydomain.co.uk/shop/conditions.php">Conditions of Use</a><br><a href="http://mydomain.co.uk/shop/contact_us.php">Contact Us</a><br><a href="http://rmydomain.co.uk/shop/dynamic_sitemap.php">Site Map</a></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end informationbox //-->
</td>
	</tr>
	<tr><td>
<!-- start cartbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Shopping Bag</td>
<td height="14" class="infoBoxHeading" nowrap><a href="http://mydomainshop/shopping_cart.php"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a><img src="images/infobox/corner_right.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td class="boxText">0 items</td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end cartbox //-->
</td>
	</tr>
	<tr><td> </td>
	</tr>
  </table>	</td>
<td valign="top">
  <p>
<!-- start Default Content //-->
<form name="order" action="https://mydomain.co.uk/shop/checkout_success.php?action=update" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="4" cellpadding="2">
	  <tr>
		<td valign="top"><img src="images/table_background_man_on_board.gif" border="0" alt="Your Order Has Been Processed!" title=" Your Order Has Been Processed! " width="1" height="1"></td>
		<td valign="top" class="main"><img src="images/pixel_trans.gif" border="0" alt="" width="1" height="10"><div align="center" class="pageHeading">Your Order Has Been Processed!</div><br>Your order has been successfully processed! Your products will arrive at their destination within 2-5 working days.<br><br>
Please notify me of updates to the products I have selected below:<br><p class="productsNotifications"><input type="checkbox" name="notify[]" value="53"> Acoustic Dreadnought style guitar<br></p>			<h3>Thanks for shopping with us online!</h3></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
  </tr>
  <tr>
	<td align="right" class="main"><input type="image" src="includes/languages/english/images/buttons/button_continue.gif" border="0" alt="Continue" title=" Continue "></td>
  </tr>
  <tr>
	<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%" align="right"><img src="images/pixel_silver.gif" border="0" alt="" width="1" height="5"></td>
			<td width="50%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
		  </tr>
		</table></td>
		<td width="25%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
		<td width="25%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%"><img src="images/pixel_silver.gif" border="0" alt="" width="100%" height="1"></td>
			<td width="50%"><img src="images/checkout_bullet.gif" border="0" alt="" width="11" height="11"></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td align="center" width="25%" class="checkoutBarFrom">Delivery Information</td>
		<td align="center" width="25%" class="checkoutBarFrom">Payment Information</td>
		<td align="center" width="25%" class="checkoutBarFrom">Confirmation</td>
		<td align="center" width="25%" class="checkoutBarCurrent">Finished!</td>
	  </tr>
	</table></td>
  </tr>

pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");


pageTracker._trackTrans();


</table></form>
<!-- end Default Content //-->
</p>
  <p> </p>	</td>
 </tr>
</table>

<table border="0" width="80%" cellspacing="0" align="center" cellpadding="1">
 <tr class="footer">
<td class="footer">  Saturday 28 June, 2008  </td>
<td align="right" class="footer"><span class="smallText">Copyright © 2008 <a href="http://mydomain.co.uk/shop/index.php">Name</a><br>Designed By <a href="http://www.mydomain.co.uk"target="_blank"></a> </span></td>
 </tr>
</table>

<br>
<br>
</body>
</html>

error.jpg

Share this post


Link to post
Share on other sites
error.jpg

 

Can anyone help me, I really want to have this on my shop and will have to remove at the weekend before it goes live if I can't get it sorted.

Share this post


Link to post
Share on other sites

HI, thank you for the great contribution.

 

I'm confused with the different Install.txt version in this contribution:

 

I try to install this contribution, there is a most updated contribution on 22 Jun 2008 with heading "portugues (PT-BR) complet package version", however, there is only a Portugues version of Install.txt file, no English one attached. This Portugues version is different from previous English version of the Install.txt file.

 

Can some one provide me with a most updated ENG complete package, please.

 

Thank you.

Share this post


Link to post
Share on other sites
Guest
Can anyone help me, I really want to have this on my shop and will have to remove at the weekend before it goes live if I can't get it sorted.

 

 

look at:

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


pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");

 

 

the problems comes from the fact that there is a

<script type="text/javascript">

 

missing

 

the working code should be:

 

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

<script type="text/javascript">		
pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");

 

in your php pages this is located in your google analytics module that write the transaction.

could you post the php code portion where the transaction strings are built (the adTrans and addItem sections)

 

I will give you the fix from there.

Share this post


Link to post
Share on other sites
I found little bugs since my last post, I will post the corrections shortly. (the e-commerce was not showing up)

 

Hey Pix, I am anxiously awaiting your 'little bug fixes'. Everything is working except e-commerce not showing up in analytics reports. I've been through code line by line and have everything as you do. Please post your fixes :) :) I am very excited to see this data! Thank you for all your fine work on this!

 

Kenya Star

Share this post


Link to post
Share on other sites
Are the changes to checkout_success instead of or as well as the changes in the contribution. I've done it as well as but I'm getting the following error and wonder if this is why:

 

pageTracker._addTrans( "70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom" ); pageTracker._addItem( "70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1"); pageTracker._trackTrans();

 

Many thanks

 

HI Lotti, I'm also using STS, I've install this contribution, however, I found the most updated PT-BR version posted was different from the previous ENG version, I did try to install the PT-BR version and follow your instruction as well, but did not work. Could you please let me know which version of Google Analytics module did you installed? Could you pls. PM me the correct install.txt file, thank you.

Share this post


Link to post
Share on other sites
look at:

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


pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");

 

 

the problems comes from the fact that there is a

<script type="text/javascript">

 

missing

 

the working code should be:

 

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

<script type="text/javascript">		
pageTracker._addTrans(
"70","boxershortz","133.49","19.06","0.00","Steventon","onbekend","United Kingdom"
);

pageTracker._addItem(
"70","53","Acoustic Dreadnought style guitar","Acoustic Guitars","108.93","1");

 

in your php pages this is located in your google analytics module that write the transaction.

could you post the php code portion where the transaction strings are built (the adTrans and addItem sections)

 

I will give you the fix from there.

This is what I have:

// Prepare the Analytics "Transaction line" string

$transaction_string = '"' . $order_id . '","' . $analytics_total . '","' . $analytics_tax . '","0.00","' . $orders['customers_city'] . '","' . $orders['customers_country'] . '"';

// Get products info for Analytics "Item lines"

$item_string = '';
$items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name");
while ($items = tep_db_fetch_array($items_query)) {
	$category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'");
	$category = tep_db_fetch_array($category_query);

  $item_string .=  "pageTracker._addItem(\n\"" . $order_id . "\",\"" . $items['products_id'] . "\",\"" . $items['products_name'] . "\",\"" . $category['categories_name'] . "\",\"" . number_format($items['final_price'], 2) . "\",\"" . $items['products_quantity'] . "\");\n";
}

// ############## Google Analytics - end ###############

?>

pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

<?php echo $item_string; ?>


pageTracker._trackTrans();

 

 

 

 

in my analytics.php file, I really appreciate your help.

 

 

Jennie, hopefully I'll get this sorted now thanks to PIXCLINIC, when I do - I'll post you the code I added as I went through this whole thread and added various tips - there was one specifically for STS - so I made some changes to the actual standard contribution - clearly not all of them correctly! :blush: I don't want to post anything misleading so let me get it working first.

 

Thanks

 

Lotti

Share this post


Link to post
Share on other sites
Guest
This is what I have:

// Prepare the Analytics "Transaction line" string

$transaction_string = '"' . $order_id . '","' . $analytics_total . '","' . $analytics_tax . '","0.00","' . $orders['customers_city'] . '","' . $orders['customers_country'] . '"';

// Get products info for Analytics "Item lines"

$item_string = '';
$items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name");
while ($items = tep_db_fetch_array($items_query)) {
	$category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'");
	$category = tep_db_fetch_array($category_query);

  $item_string .=  "pageTracker._addItem(\n\"" . $order_id . "\",\"" . $items['products_id'] . "\",\"" . $items['products_name'] . "\",\"" . $category['categories_name'] . "\",\"" . number_format($items['final_price'], 2) . "\",\"" . $items['products_quantity'] . "\");\n";
}

// ############## Google Analytics - end ###############

?>

pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

<?php echo $item_string; ?>


pageTracker._trackTrans();

 

 

 

 

in my analytics.php file, I really appreciate your help.

 

 

Jennie, hopefully I'll get this sorted now thanks to PIXCLINIC, when I do - I'll post you the code I added as I went through this whole thread and added various tips - there was one specifically for STS - so I made some changes to the actual standard contribution - clearly not all of them correctly! :blush: I don't want to post anything misleading so let me get it working first.

 

Thanks

 

Lotti

 

could you post the entire page please?

Share this post


Link to post
Share on other sites
could you post the entire page please?

sorry, heres is the file which is in catalog\includes\modules\analytics\analytics.php

 

<?php
/*
==========================================================
Include Google Analystics module for osCommerce
  Added by  Clement Nicolaescu (http://www.osCoders.biz) 
v. 1.0.0 - 2005/11/15

 Google Analytics Beta modification v 2.1.0 2008/01/15 by:
 Tomas Hesseling (www.boxershortz.nl) &
 Mathieu Burgerhout (www.seo-for-osc.com)
==========================================================	
--------------------------------------------------
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
--------------------------------------------------

 Released under the GNU General Public License
*/

// ############## Google Analytics - start ###############

// Get order id
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$order_id = $orders['orders_id'];

// Get order info for Analytics "Transaction line" (affiliation, city, state, country, total, tax and shipping)

// Set value for  "affiliation"

$analytics_affiliation = '';


// Get info for "city", "state", "country"
$orders_query = tep_db_query("select customers_city, customers_state, customers_country from " . TABLE_ORDERS . " where orders_id = '" . $order_id . "' AND customers_id = '" . (int)$customer_id . "'");
$orders = tep_db_fetch_array($orders_query);

$totals_query = tep_db_query("select value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
// Set values for "total", "tax" and "shipping"
$analytics_total = '';
$analytics_tax = '';
$analytics_shipping = '';

 while ($totals = tep_db_fetch_array($totals_query)) {

	if ($totals['class'] == 'ot_total') {
		$analytics_total = number_format($totals['value'], 2);
		$total_flag = 'true';
	} else if ($totals['class'] == 'ot_tax') {
		$analytics_tax = number_format($totals['value'], 2);
		$tax_flag = 'true';
	} else if ($totals['class'] == 'ot_shipping') {
		$analytics_shipping = number_format($totals['value'], 2);
		$shipping_flag = 'true';
	}

 }

// Prepare the Analytics "Transaction line" string

$transaction_string = '"' . $order_id . '","' . $analytics_total . '","' . $analytics_tax . '","0.00","' . $orders['customers_city'] . '","' . $orders['customers_country'] . '"';

// Get products info for Analytics "Item lines"

$item_string = '';
$items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name");
while ($items = tep_db_fetch_array($items_query)) {
	$category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'");
	$category = tep_db_fetch_array($category_query);

  $item_string .=  "pageTracker._addItem(\n\"" . $order_id . "\",\"" . $items['products_id'] . "\",\"" . $items['products_name'] . "\",\"" . $category['categories_name'] . "\",\"" . number_format($items['final_price'], 2) . "\",\"" . $items['products_quantity'] . "\");\n";
}

// ############## Google Analytics - end ###############

?>

pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

<?php echo $item_string; ?>


pageTracker._trackTrans();

Share this post


Link to post
Share on other sites
Guest

change

 

// ############## Google Analytics - end ###############

?>

pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

 

to

// ############## Google Analytics - end ###############

?>
<script type="text/javascript">
pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

 

and let me know

Share this post


Link to post
Share on other sites
sorry, heres is the file which is in catalog\includes\modules\analytics\analytics.php

 

<?php
/*
==========================================================
Include Google Analystics module for osCommerce
  Added by  Clement Nicolaescu (http://www.osCoders.biz) 
v. 1.0.0 - 2005/11/15

 Google Analytics Beta modification v 2.1.0 2008/01/15 by:
 Tomas Hesseling (www.boxershortz.nl) &
 Mathieu Burgerhout (www.seo-for-osc.com)
==========================================================	
--------------------------------------------------
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
--------------------------------------------------

 Released under the GNU General Public License
*/

// ############## Google Analytics - start ###############

// Get order id
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$order_id = $orders['orders_id'];

// Get order info for Analytics "Transaction line" (affiliation, city, state, country, total, tax and shipping)

// Set value for  "affiliation"

$analytics_affiliation = '';


// Get info for "city", "state", "country"
$orders_query = tep_db_query("select customers_city, customers_state, customers_country from " . TABLE_ORDERS . " where orders_id = '" . $order_id . "' AND customers_id = '" . (int)$customer_id . "'");
$orders = tep_db_fetch_array($orders_query);

$totals_query = tep_db_query("select value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
// Set values for "total", "tax" and "shipping"
$analytics_total = '';
$analytics_tax = '';
$analytics_shipping = '';

 while ($totals = tep_db_fetch_array($totals_query)) {

	if ($totals['class'] == 'ot_total') {
		$analytics_total = number_format($totals['value'], 2);
		$total_flag = 'true';
	} else if ($totals['class'] == 'ot_tax') {
		$analytics_tax = number_format($totals['value'], 2);
		$tax_flag = 'true';
	} else if ($totals['class'] == 'ot_shipping') {
		$analytics_shipping = number_format($totals['value'], 2);
		$shipping_flag = 'true';
	}

 }

// Prepare the Analytics "Transaction line" string

$transaction_string = '"' . $order_id . '","' . $analytics_total . '","' . $analytics_tax . '","0.00","' . $orders['customers_city'] . '","' . $orders['customers_country'] . '"';

// Get products info for Analytics "Item lines"

$item_string = '';
$items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name");
while ($items = tep_db_fetch_array($items_query)) {
	$category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'");
	$category = tep_db_fetch_array($category_query);

  $item_string .=  "pageTracker._addItem(\n\"" . $order_id . "\",\"" . $items['products_id'] . "\",\"" . $items['products_name'] . "\",\"" . $category['categories_name'] . "\",\"" . number_format($items['final_price'], 2) . "\",\"" . $items['products_quantity'] . "\");\n";
}

// ############## Google Analytics - end ###############

?>

pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

<?php echo $item_string; ?>


pageTracker._trackTrans();

 

Unfortunately I still get the same problem :(

Share this post


Link to post
Share on other sites

Hi there,

 

I'm using oscmax which uses the BTS. Any chance someone could post step by step instructions on how to make this work in BTS/OSCMAX? I have put the basic tracking code in the mainpage.tpl.php right at the bottom.

 

The analytics.php call is made here in checkout_success.php:

 

}

// EOF: MOD - PWA:  Added a check for a Guest checkout and cleared the session - 030411 v0.71



 $content = CONTENT_CHECKOUT_SUCCESS;



 include (bts_select('main', $content_template)); // BTSv1.5



 require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

<?php
// osCoders.biz - Analystics - start
	include(DIR_WS_MODULES . 'analytics/analytics.php');
// osCoders.biz - Analistics - end
?>
</body>

 

I'm happy to take suggestions on what to try or if anyone has had luck installing the proper e-commerce tracking in oscmax please post and help.

 

I have found that the new google ga.js code doesn't work properly on my site for some reason. The old urchin code works much better. ga.js seems to not record the goals or the visits properly... only abut 1/5th show up. All of them show up properly with urchin.

 

Thanks in advance for any suggestions.

Share this post


Link to post
Share on other sites

Hey Pix I need your help please!!

I have everything working except the e-commerce stats. It shows up in the view page source of the receipt page but it is not showing up in google analytics ecommerce reports. Below is my code. I really appreciate any suggestions and really appreciate your work on this. -KenyaStar

 

Here's is the file which is in catalog\includes\google_analytics.php (I've replaced my actual account number with XXX)

<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-XXXXXXX-1");
  pageTracker._initData();
  pageTracker._trackPageview();
</script>

 

Here's is the file which is in catalog\includes\modules\analytics\analytics.php

 

<?php
/*
==========================================================
Include Google Analystics module for osCommerce
  Modified by PIXCLINIC (http://www.pixclinic.com)
v. 1.0.0 - 2008/04/07
==========================================================	

--------------------------------------------------
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
--------------------------------------------------

 Released under the GNU General Public License
*/

// ############## Google Analytics - start ###############

// Get order id
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$order_id = $orders['orders_id'];

// Get order info for Analytics "Transaction line" (affiliation, city, state, country, total, tax and shipping)

// Set value for  "affiliation"

$analytics_affiliation = 'Armani Imports';


// Get info for "city", "state", "country"
$orders_query = tep_db_query("select customers_city, customers_state, customers_country from " . TABLE_ORDERS . " where orders_id = '" . $order_id . "' AND customers_id = '" . (int)$customer_id . "'");
$orders = tep_db_fetch_array($orders_query);

$totals_query = tep_db_query("select value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
// Set values for "total", "tax" and "shipping"
$analytics_total = '';
$analytics_tax = '';
$analytics_shipping = '';

 while ($totals = tep_db_fetch_array($totals_query)) {

	if ($totals['class'] == 'ot_total') {
		$analytics_total = number_format($totals['value'], 2);
		$total_flag = 'true';
	} else if ($totals['class'] == 'ot_tax') {
		$analytics_tax = number_format($totals['value'], 2);
		$tax_flag = 'true';
	} else if ($totals['class'] == 'ot_shipping') {
		$analytics_shipping = number_format($totals['value'], 2);
		$shipping_flag = 'true';
	}

 }

/* Prepare the Analytics "Transaction line" string
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._addTrans(
  "1234",			 // order ID - required
  "Mountain View",	// affiliation or store name
  "11.99",			// total - required
  "1.29",			 // tax
  "5",				// shipping
  "San Jose",		 // city
  "California",	   // state or province
  "USA"			   // country
);
*/

$transaction_string = '
<script type="text/javascript">
pageTracker._addTrans( ';
$transaction_string .= '"' . $order_id . '",';
$transaction_string .= '"' . $analytics_affiliation . '",';
$transaction_string .= '"' . $analytics_total . '",';
$transaction_string .= '"' . $analytics_tax . '","';
$transaction_string .= '"' . $analytics_shipping . '",';
$transaction_string .= '"' . $orders['customers_city'] . '",';
$transaction_string .= '"' . $orders['customers_state'] . '",';
$transaction_string .= '"' . $orders['customers_country'] .'"';
$transaction_string .= ');';



/* Get products info for Analytics "Item lines"
pageTracker._addItem(
  "1234",			 // order ID - required
  "DD44",			 // SKU/code
  "T-Shirt",		  // product name
  "Green Medium",	 // category or variation
  "11.99",			// unit price - required
  "1"				 // quantity - required
);
pageTracker._trackTrans();
</script>


*/

$items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name");
while ($items = tep_db_fetch_array($items_query)) {
	$category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'");
	$category = tep_db_fetch_array($category_query);	


$item_string = ' pageTracker._addItem(';
$item_string .= '"' . $order_id . '",';
$item_string .= '"' . $items['products_id'] . '",';
$item_string .= '"' . $items['products_name'] . '",';
$item_string .= '"' . $category['categories_name'] . '",';
$item_string .= '"' . number_format($items['final_price'], 2) . '",';
$item_string .= '"' . $items['products_quantity'] . '"';  }

// ############## Google Analytics - end ###############

?>
<script type="text/javascript">
pageTracker._addTrans(
<?php echo $transaction_string; ?>

);

<?php echo $item_string; ?>


pageTracker._trackTrans();

Share this post


Link to post
Share on other sites

I am also experiencing the situation where paypal IPN orders do not get recorded in google analytics. I believe what is happening is that the customer does not return to the store after purchasing - so checkout_success is never reached. I do not see where I would report the purchase to google in the IPn processing code. I have to admit that I have trouble following the IPN code.

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites
Guest

Topic: Integration issue with Authorize.net

 

Synopsis: We use authorize.net with our OS Commerce cart and while this contribution seems to work great, every new order processed comes up with the Order Number as being "0". Thus instead of being orders "201", "202", "203", it is "0", "0", "0". Anyone have any idea why the order ID is coming up properly?

 

Thanks,

Dan

Share this post


Link to post
Share on other sites

Hi Guys,

 

I have implemented the new module and all the pages are being tracked correctly as expected, the only thing that is not appearing in the analytics are the sales, this is what is being generated on the checkout_success page, i have removed out google id etc

 

<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-x");

pageTracker._initData();

pageTracker._setDomainName("storename");

pageTracker._trackPageview();

<form style="display:none;" name="utmform">

<textarea id="utmtrans">UTM:T|2208||7.98|1.19|4.99|Oxford||United Kingdom UTM:I|2208|3615|1/2 Female & 1/2 Male Adaptor- 10 litre|Ancillary Items|2.54|1</textarea>

</form>

</script><!-- footer_eof //-->

<br>

<form style="display:none;" name="utmform">

<textarea id="utmtrans">UTM:T|2208||7.98|1.19|4.99|Oxford||United Kingdom UTM:I|2208|3615|1/2 Female & 1/2 Male Adaptor- 10 litre|Ancillary Items|2.54|1</textarea>

</form>

 

is something incorrect or have i missed something??

 

Thanks, Tim.

Share this post


Link to post
Share on other sites

Hi Guys,

 

After more investigation i cannot understand why this is appearing in the code

 

<form style="display:none;" name="utmform">

<textarea id="utmtrans">UTM:T|2208||7.98|1.19|4.99|Oxford||United Kingdom UTM:I|2208|3615|1/2 Female & 1/2 Male Adaptor- 10 litre|Ancillary Items|2.54|1</textarea>

</form>

 

and not Example from google.

 

var pageTracker = _gat._getTracker("UA-12345-1");

pageTracker._trackPageview();

pageTracker._addTrans(

"1234", // order ID - required

"Womens Apparel", // affiliation or store name

"11.99", // total - required

"1.29", // tax

"15.00", // shipping

"San Jose", // city

"California", // state or province

"USA" // country

);

pageTracker._addItem(

"1234", // item number

"DD44", // SKU/code - required

"T-Shirt", // product name

"Olive Medium", // category or variation

"11.99", // unit price - required

"1" // quantity - required

);

pageTracker._trackTrans();

 

Any help you would great. Looking in the analytics.php file the code from google should be appearing but it seems that the code is not being outputted.

 

Thanks, Tim.

Share this post


Link to post
Share on other sites
Guest

This is the goal of Google Analytics.

 

"Every successful transaction made in your store is now trackable in Google Analytics."

 

I know Google is the "big dog" but am I the only one that thinks giving Google all this type of information is crazy?

 

Your making sure that they know all your financial information! If you are really profitably and they choose to compete with you (even covertly) they can crush you. On the internet you must put up with Google but come on!

 

Ki

TEXMOOD.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×