Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google Analytics Ecommerce tracking not working


galey1981

Recommended Posts

Hi All

 

I have a heavily modded version of Oscommerce running and would really like to get eCommerce tracking working through Google Analytics so I can track AdWords, work out AOV and so on. The basic tracking works e.g. visitors etc and it recognises the website but it says zero transactions in the ecommerce stats area of Google Analytics. I'm using the osCommerce Google Analytics module contribution.

 

I have this code placed in all of the STS template pages, the UA bit has the correct number in 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">
	var pageTracker = _gat._getTracker("UA-xxxxxxxx-x");
	pageTracker._initData();
	pageTracker._trackPageview();
</script>

 

and on checkout_success.php I have this:

 


<?php
//google analytics
     require(DIR_WS_MODULES . 'analytics/analytics.php')
?>
<?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>

 

But sadly its only the ecommerce part which is not working. I do also have Dynamoeffect's Paypal Express Payment module installed - but even still this module takes the customer to checkout_success.php at the end of the transaction so I'm not sure what's going wrong. I don't believe this payment module would be causing the problem.....

 

Any suggestions?

Link to comment
Share on other sites

  • 3 months later...

Hi All

 

I have a heavily modded version of Oscommerce running and would really like to get eCommerce tracking working through Google Analytics so I can track AdWords, work out AOV and so on. The basic tracking works e.g. visitors etc and it recognises the website but it says zero transactions in the ecommerce stats area of Google Analytics. I'm using the osCommerce Google Analytics module contribution.

 

I have this code placed in all of the STS template pages, the UA bit has the correct number in 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">
	var pageTracker = _gat._getTracker("UA-xxxxxxxx-x");
	pageTracker._initData();
	pageTracker._trackPageview();
</script>

 

and on checkout_success.php I have this:

 


<?php
//google analytics
     require(DIR_WS_MODULES . 'analytics/analytics.php')
?>
<?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>

 

But sadly its only the ecommerce part which is not working. I do also have Dynamoeffect's Paypal Express Payment module installed - but even still this module takes the customer to checkout_success.php at the end of the transaction so I'm not sure what's going wrong. I don't believe this payment module would be causing the problem.....

 

Any suggestions?

Hi

Did you ever resolve this issue as i'm experiencing the same problem currently.

Any advice would be appreciated.

regards

Jamil

Link to comment
Share on other sites

  • 1 month later...

Hi All

 

I have a heavily modded version of Oscommerce running and would really like to get eCommerce tracking working through Google Analytics so I can track AdWords, work out AOV and so on. The basic tracking works e.g. visitors etc and it recognises the website but it says zero transactions in the ecommerce stats area of Google Analytics. I'm using the osCommerce Google Analytics module contribution.

 

I have this code placed in all of the STS template pages, the UA bit has the correct number in it:

 

But sadly its only the ecommerce part which is not working. I do also have Dynamoeffect's Paypal Express Payment module installed - but even still this module takes the customer to checkout_success.php at the end of the transaction so I'm not sure what's going wrong. I don't believe this payment module would be causing the problem.....

 

Any suggestions?

 

I'm sure this is coming too late for you, but here's a couple of comments. You are probably very aware of all of this. If so, please don't think I'm talking down to you. I'm doing this to fill in gaps or misperceptions of others, too.

 

1) Google Analytics is a good "site-wide" tracking mechanism that will report information on a per-visit basis. If correctly configured (and no, I don't have the code correction that you ask for), it can break down sales by click source.

 

2) Google Adwords has its *own* tracking mechanism. It relies on cookies for tracking, but for an advertiser trying to truly put an ROI on their Adwords investment, it can be much more revealing.

 

The Analytics tracking code doesn't communicate with the Adwords tracking code (though it can track Adwords sales by using its own code).

 

Why do I like using Adwords tracking instead of Analytics? Let me give a scenario:

 

A visitor clicks on an Adwords ad to visit your site on Saturday. On Monday she returns by entering your URL directly in her browser and places a $250 order. If you have Analytics installed properly, you can track that $250 order... but because it is a session-based reporting tool, it will show the source of the $250 order as "Direct", not a PPC sale. A correctly configured Adwords, with the proper code placed on the post-sale "thank you" page, will give the visitor a cookie on the Saturday visit, and then properly track that visitor for the following 30 days (or less if you choose to track for fewer days), crediting the sale after the fact.

 

It seems that many people get these two Google sales tracking tools confused, and it can cause real confusion. If you want Adwords sales tracking, just log into your Adwords account, click "Reporting" then "Conversions" and get the tracking code. You'll have to modify it (per the instructions provided) to actually track sales amount and not just total #s of conversions.

 

Now... I'm not an osCommerce expert (at all), just someone who's PPC clients need to interface with it. I found this thread looking for an answer myself. If anyone could point me to the osCommerce variable that holds the sales total, I'd greatly appreciate it!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...