Dynamic Google Analytics 2.0

TheProphet

New Member
For visitors who didn't understand what the hack does:

It creates a google analytics section in your vb options page and when you enter analytics ID there, it automatically puts analytics code into your footer.

If you don't install this hack, you can do the same by copy/pasting google analytics code in your footer template.

Now with the latest google code.

old
PHP:
<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">
var pageTracker = _gat._getTracker("{$vbulletin->options['uacode']}");
pageTracker._initData();
pageTracker._trackPageview();
</script>

new:
PHP:
<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("{$vbulletin->options['uacode']}");
pageTracker._trackPageview();
} catch(err) {}
</script>
 
can u tell me how it work

im imported the hack then put the google code in it which start with UA-

ok

then i must put this code in footer ?

<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("{$vbulletin->options['uacode']}");
pageTracker._trackPageview();
} catch(err) {}
</script>
 
no he says that's the same thing, as you installed the xml you don't need to edit the footer,

but like you i installed xml product and put the google code in options and there isn't the script code in my footer...

but i don't understand where can we see the analytics' page?

is it on vbulletin?

vbseo.com had made a great dynamic side bar for google stats in the left side of its pages
 
Kena said:
no he says that's the same thing, as you installed the xml you don't need to edit the footer,

but like you i installed xml product and put the google code in options and there isn't the script code in my footer...

but i don't understand where can we see the analytics' page?

is it on vbulletin?

vbseo.com had made a great dynamic side bar for google stats in the left side of its pages

Google Analytics
Login with your user details you greated to get dynamics.
 
Thanks Sir I know it would be necessary to log on the url you posted but I thought there was also a available vbulletin page for that, like vbseo.com

=)
 
Just added this to my site. But does this "Use this to temporarily dis-/en-able the dynamic inclusion of Google Analytics." Need to be set to Yes or No? I have it set to yes at the moment and it hasn't tracked visits.
 
Back
Top