Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Where to paste the Google Analytics Code?


scarletttam

Recommended Posts

Hi,

 

I was trying to find the right spot to put my google analytics code. It says put the code onto every page that I want to track immediately before </head> tag . I want to track my product pages.

 

<script type="text/javascript">

 

var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-xxxxxxx-x']);

_gaq.push(['_trackPageview']);

 

(function() {

var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

})();

 

</script>

Link to comment
Share on other sites

In version 2.3.1, you don't need to change any file, there is a module for that available, under admin>modules>header tags

 

Install the googe analytics module and then just type your google number into there

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...