Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
semperaye
Worker
Worker


Joined: Oct 31, 2011
Posts: 100
Location: North Carolina

PostPosted: Fri Feb 22, 2013 9:40 am Reply with quote

There are instructions on how create a php file for this but thats rather confusing to me, is there a better way? At the very least maybe just pasting the code on the home page somehow?
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Fri Feb 22, 2013 10:26 am Reply with quote

Create a file in includes/addons and name it head-analytics.php and paste this in it

Code:


<?php
/*
  $GA_Tracker change the value to your own
*/
$GA_Tracker = 'UA-********-*';

// Don't track stats on admin functions
if (!defined('ADMIN_FILE')) {
    $GA_HTML = '<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push([\'_setAccount\', \'' . $GA_Tracker . '\']);
_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>';
addJSToHead($GA_HTML, 'inline');
}

?>


make sure you replace $GA_Tracker = 'UA-********-*'; with your correct value.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
semperaye
PostPosted: Sat Feb 23, 2013 11:36 am Reply with quote

works great, now i think i know how the header works
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©