Jump to content

google analytics tracking to my template


agtatsi

Recommended Posts

I paste this code....<script>

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
  ga('create', 'UA-53026177-1', 'auto');
  ga('send', 'pageview');
 
</script>
I use 1.5 ps version..!!!
  • Like 1
Link to comment
Share on other sites

On header.

 

I tried to paste in footer, when i went to verify my site in webmaster tools, it said there is no google analytics code.

 

When i pasted it in header, my site successfully verified using webmaster tools owner. Well, there are many alternatives in verifying ownership in webmaster tools, but the failure to read analytic codes seemed that it is better to put in header.

  • Like 1
Link to comment
Share on other sites

ok..thank you.!One more question in which point in header.tpl file I should paste the code from google analytics ???? For example before the closing tag </head> or somewhere else????? Should I modify the code or I should let it as it given by google analytics?????

Edited by agtatsi (see edit history)
Link to comment
Share on other sites

Which is preferable to paste google analytics code in footer.tpl or in header.tpl???

 

the best practice is to use the Google Analytics module, to find in modules search bar type analytics, you can then install and configure. 

This uses the correct hook to place the needed code in your header.  Of course if you are using custom code then you would want to modify the header.tpl.

  • Like 1
Link to comment
Share on other sites

I don't think there is any 'wait' time, once installed and configured simply visit your google analtyics, use 'real time-->overview', then in another browser visit your shop.

 

then you should see your visit in the anaytics real time overview screen.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

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
×
×
  • Create New...