MyBB Community Forums

Full Version: Google Analytics
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

Does anyone know which template I insert GA into? I put it into the index tpl but nothing is showing up in my GA account summary and I did it a few hours ago. Do I need to wait longer or is it the wrong tpl? Thanks for the help.
(2009-03-16, 04:23 AM)Joshua Mayer Wrote: [ -> ]http://www.mybbcentral.com/thread-1641.html

You need to be subscriber to download plugins from MyBB Central. Wink

Just thought I'd post this before someone says they can't download that plugin.
(2009-03-16, 04:26 AM)Snowman01 Wrote: [ -> ]
(2009-03-16, 04:23 AM)Joshua Mayer Wrote: [ -> ]http://www.mybbcentral.com/thread-1641.html

You need to be subscriber to download plugins from MyBB Central. Wink

Just thought I'd post this before someone says they can't download that plugin.
Whoops, Forgot Toungue
Uhm, there is no .tpl templates in 1.4..
tpl = abbreviation for template. i meant the index template
Ah, my badToungue I thought you meant .tpl filesToungue If your code is correct, you should be able to put it in the index template.
Aren't you meant to put GA at the bottom of the page, before the end of the body/html but after the content?

In which case, put it in the footer template.
Hey Guys i already add my code, for Google Analytics;

My code
<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-7943701-1");
pageTracker._trackPageview();
} catch(err) {}</script>

I Add the code in Index Templates, before the <body></body>....
It's the correct form?;


<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>  <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-7943701-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<body>
{$header}
{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
	<dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->no_new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
	<dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>


Need Someting?, Why Google Analytics don't show me forum visits?
No it says to put it directly before </body>, and it doesn't start showing details the second you put it in, can take a while.