Log in

View Full Version : Whats the require_once file again for all vb pages?


need2fart
09-30-2010, 11:04 PM
Was it global.php?

I'm trying to add Google analytics to my site and I don't remember the file that is used in all vB pages.

Was is global.php?

I want to do require_once('googleAnalytics.php');

Thanks.

--------------- Added 1285893243 at 1285893243 ---------------

Okay it is global.php. However when I do include my file, <script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18840951-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>

It keeps saying my headers were already sent in VB. What do I do to make it work?

Lynne
09-30-2010, 11:39 PM
The only google analytics code I know of is some javascript that looks like what you posted that you just need to put into your footer template. Why are you adding it to your global.php page?

need2fart
09-30-2010, 11:55 PM
The only google analytics code I know of is some javascript that looks like what you posted that you just need to put into your footer template. Why are you adding it to your global.php page?

Good point. I was trying to include it in global.php because that's the page that is included in the index. So all visitors would see it.

I'll add it too the footer template, I appreciate it Lynne:) I wish I thought of that, blonde moment.

--------------- Added 1285894885 at 1285894885 ---------------

Thanks Lynne again, you solved my problem. :)