Location: PHPKode > projects > BluuCMS > bluucms-1.0/bluu-content/plugins/google-analytics/analytics.php
<?php
/* 
 * Plugin Name: Google Analytics
 * Plugin URI: http://www.google.com/analytics/
 * Description: The BluuCMS Plugin to include your Google Analytics into your site.
 * Author: Wade Wildbore
 * Version: 1.0 
 * Author URI: http://www.bluu.co.nz
 */  


function google_analytics(){
	
	global $plugin;
	
	echo "\n".'<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("'.$plugin->get_setting('google-analytics', 'id').'");
	pageTracker._trackPageview();
	} catch(err) {}</script>'."\n";
	
}

$plugin->add_admin('analytics_admin.php');
$plugin->add_action('footer','google-analytics', 'google_analytics');

?>
Return current item: BluuCMS