View Full Version : how I add google analytics code on archive ?
Ba$im
08-24-2008, 02:53 PM
hi
I just notic that my google-analytics code not shown on all archive pages
how can I add google-analytics code on archive footer for example?
Lynne
08-24-2008, 03:56 PM
I think the only page used in the archive is the index.php page? I'm not too sure. But, it's just a php page with no templates, so I would think you can add it there. I'd have to look at it if you need more detail.
edit: It looks like you can just add it in the $output tag at the bottom of the page. Just make sure you escape all your quotes.
Dismounted
08-25-2008, 10:33 AM
You can use the following plugin at archive_complete.
$output .= '<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("UA-4323223-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>';
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.