Jump to content



Photo
- - - - -

Where to paste the Google Analytics Code?


This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1   scarletttam

scarletttam
  • Members
  • 8 posts

Posted 05 July 2012 - 15:07

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>

#2 ONLINE   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,566 posts

Posted 05 July 2012 - 15:13

What osCommerce version are you using?

#3   scarletttam

scarletttam
  • Members
  • 8 posts

Posted 05 July 2012 - 19:00

@multimixer 2.3 /smile.png' class='bbc_emoticon' alt=':)' />

#4   Biancoblu

Biancoblu

    1291 Giger's Alien

  • Community Sponsor
  • 745 posts

Posted 05 July 2012 - 19:31

I put mine in includes>footer.php, so it covers all pages.
~ Don't mistake my kindness for weakness ~

#5   scarletttam

scarletttam
  • Members
  • 8 posts

Posted 05 July 2012 - 20:08

@Biancoblu Thank you so much. It worked /smile.png' class='bbc_emoticon' alt=':)' />

#6   Biancoblu

Biancoblu

    1291 Giger's Alien

  • Community Sponsor
  • 745 posts

Posted 05 July 2012 - 20:59

you're welcome /smile.png' class='bbc_emoticon' alt=':)' />
~ Don't mistake my kindness for weakness ~

#7 ONLINE   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,566 posts

Posted 06 July 2012 - 05:39

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