<commit_before><?php
// $Id: /cvsroot/tikiwiki/tiki/lib/wiki-plugins/wikiplugin_articles.php,v 1.27.2.1 2007-12-27 21:46:42 pkdille Exp $

function wikiplugin_googleanalytics_info() {
	return array(
		'name' => tra('Google Analytics'),
		'documentation' => 'PluginGoogleAnalytics',	
		'description' => tra('Add the tracking code for Google Analytics.'),
		'prefs' => array( 'wikiplugin_googleanalytics' ),
		'params' => array(
			'account' => array(
				'required' => true,
				'name' => tra('Account number'),
				'description' => tra('The account number for the site. Your account number from google looks like HA-xxxxxxx-x. All you need to enter is xxxxxxx-x'),
			),
		),
	);
}

function wikiplugin_googleanalytics($data, $params) {
	extract($params,EXTR_SKIP);
	if (empty($account)) {
		return tra('Missing parameter');
	}
	$ret = '<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-'.$account.'");<commit_msg>[MOD] changed the account param definition with the proper Google Account Format<commit_after><?php
// $Id: /cvsroot/tikiwiki/tiki/lib/wiki-plugins/wikiplugin_articles.php,v 1.27.2.1 2007-12-27 21:46:42 pkdille Exp $

function wikiplugin_googleanalytics_info() {
	return array(
		'name' => tra('Google Analytics'),
		'documentation' => 'PluginGoogleAnalytics',	
		'description' => tra('Add the tracking code for Google Analytics.'),
		'prefs' => array( 'wikiplugin_googleanalytics' ),
		'params' => array(
			'account' => array(
				'required' => true,
				'name' => tra('Account number'),
				'description' => tra('The account number for the site. Your account number from google looks like HA-XXXXXXX-YY. All you need to enter is XXXXXXX-YY'),
			),
		),
	);
}

function wikiplugin_googleanalytics($data, $params) {
	extract($params,EXTR_SKIP);
	if (empty($account)) {
		return tra('Missing parameter');
	}
	$ret = '<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-'.$account.'");
{'fraction_non_alphanumeric': 0.1814499797488862, 'fraction_numerical': 0.01863102470635885, 'mean_word_length': 4.909090909090909, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '126777', 'n_tokens_mistral': 888, 'n_tokens_neox': 832, 'n_words': 186}