FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » Analytics (Error)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Analytics [message #165957] Fri, 02 September 2011 12:41 Go to next message
Anik is currently offline  Anik
Messages: 36
Registered: August 2011
Location: India
Karma: 0
Member
Hello,

i was trying to add ggl analytics code on my forum..
but each time i am adding it to the header.tmpl file, th forum becoming unusable..
even i can't access the admin panel also..
i tried the footer file,
but same problem..
do you have any idea where i have to add it?

Thanks,
Re: Analytics [message #165958 is a reply to message #165957] Fri, 02 September 2011 12:48 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
I don't mess with such things but I'm pretty sure it goes in the footer, do a search I believe there was a topic on it some time back that might have more info.

"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Analytics [message #165959 is a reply to message #165958] Fri, 02 September 2011 13:56 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You have 2 options:
1. Edit your footer.tmpl, add the Google code and rebuild your themes.
2. Enable the google_analytics plugin (much easier, obviously!)
Re: Analytics [message #165964 is a reply to message #165959] Fri, 02 September 2011 15:44 Go to previous messageGo to next message
Anik is currently offline  Anik
Messages: 36
Registered: August 2011
Location: India
Karma: 0
Member
Hello,

this is the footer file i added the content but after rebuilding the theme site becoming unavailable, even i cant use admin panel so i have to reinstall the forum and lost all data..
/**
* copyright            : (C) 2001-2011 Advanced Internet Designs Inc.
* email                : forum(at)prohost(dot)org
* $Id: footer.tmpl 5325 2011-07-15 14:14:17Z naudefj $
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; version 2 of the License.
**/

{MAIN_SECTION: footer // The forum's footer.}
{IF: !empty($RIGHT_SIDEBAR)}
</td><td width="200px" align-"right" valign="top" class="sidebar-right">
	{VAR: RIGHT_SIDEBAR}
{ENDIF}
</td></tr></table>

</div>
<div class="footer ac">
	<b>.::</b>
	<a href="mailto:{GVAR: ADMIN_EMAIL}">{MSG: forum_contact}</a>
	<b>::</b>
	<a href="{TEMPLATE: footer_lnk}">{MSG: forum_home}</a>
	<b>::.</b>
	<p class="SmallText">Powered by FUD Forum</p>
</div>
{INJECTION_POINT: right_block}

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24****9-1']);
  _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>
</body></html>
{MAIN_SECTION: END}

{MAIN_SECTION: footer_plain // Yet another footer for plain pages such as popups.}
</div>
</body></html>
{MAIN_SECTION: END}

{SECTION: footer_lnk // Link to forum's Home Page.}
{ROOT}?t=index&amp;{DEF: _rsid}
{SECTION: END}
Re: Analytics [message #165966 is a reply to message #165964] Fri, 02 September 2011 15:49 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You need to change all the single quotes in the JavaScript code to double quotes. Escaping will also work if you insist.
Re: Analytics [message #165968 is a reply to message #165964] Fri, 02 September 2011 15:57 Go to previous message
Anik is currently offline  Anik
Messages: 36
Registered: August 2011
Location: India
Karma: 0
Member
u mean this

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24****9-1']);
  _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>


to this,

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(["_setAccount", "UA-24****9-1"]);
  _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>

[Updated on: Fri, 02 September 2011 15:58]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Backup/restore fails 3.0.3RC1 (FIXED)
Next Topic: open_basedir restriction.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 21:18:55 GMT 2024

Total time taken to generate the page: 0.03955 seconds