Support Forums

Correctly adding Google analytics code

This is a discussion on Correctly adding Google analytics code within the Site Marketing forums, part of the General category; I tried to add analytics code to layout.tpl without success. In both cases, when added to in the end of ...


Go Back   68 Classifieds Forums > General > Site Marketing

Reply
 
Thread Tools Display Modes
Old 07-01-2010, 06:22 PM   #1
Junior Member
 
Join Date: Jul 2010
Posts: 5
Rep Power: 0
marketplace is on a distinguished road
Default Correctly adding Google analytics code

I tried to add analytics code to layout.tpl without success.

In both cases, when added to in the end of the header or at the end of the body the site does not show at all.

Is there something I may be over-looking?

I could use some help on this. I would appreciate any suggestions.
It's important for me to have google analytics tracking.

Is there a plugin or addon that is in the works where users could just add the code into a field and save for it to be added to the proper area? I have that with other scripts I have an license for.
marketplace is offline   Reply With Quote
Old 07-01-2010, 06:25 PM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,433
Rep Power: 87
seymourjames is a jewel in the rough
Default

Are you doing it like this in your layout.tpl file

{modulehook function="tpl_layout_footer" options=""}
{literal}

<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">
try {
var pageTracker = _gat._getTracker("UA-12657XX29-1");
pageTracker._trackPageview();
} catch(err) {}</script>

{/literal}
</body>
</html>
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Old 07-01-2010, 10:31 PM   #3
Junior Member
 
Join Date: Jul 2010
Posts: 5
Rep Power: 0
marketplace is on a distinguished road
Default

I left out the {literal} tags earlier.

Thanks I think I got it right now.
marketplace is offline   Reply With Quote
Old 07-26-2010, 11:20 AM   #4
Customer
 
musikal's Avatar
 
Join Date: Aug 2007
Location: The Desert
Posts: 24
Rep Power: 18
musikal is on a distinguished road
Default That works

Thanks so much for the {literal} tags, got smarty errors before this.
musikal is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Analytics Mark Kelly Technical Support 3 07-10-2009 07:24 PM
Google analytics, how do i get access to write code ryanreed71 Technical Support 1 03-31-2009 08:34 PM
Adding Google Analytics gabs Technical Support 10 01-27-2009 05:02 PM
Google Analytics Code ryanreed71 Technical Support 2 12-31-2008 12:51 PM


All times are GMT -4. The time now is 10:19 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0