Setup/Tracking

* added tracking code for Google Analytics
   - enabling is optional
   - add account in config to enable tracking
 * removed usage tracking
   - the results were just seriously depressing..
This commit is contained in:
Sarjuuk
2015-07-13 22:48:46 +02:00
parent 7eda6dd778
commit b6e1bcaeac
9 changed files with 256 additions and 27 deletions

View File

@@ -1,12 +1,12 @@
<title><?php echo htmlentities(implode(' - ', $this->title)); ?></title>
<title><?=htmlentities(implode(' - ', $this->title)); ?></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="SHORTCUT ICON" href="<?php echo STATIC_URL; ?>/images/logos/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="<?php echo STATIC_URL; ?>/download/searchplugins/aowow.xml" title="Aowow" />
<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL.'/css/basic.css?'.AOWOW_REVISION; ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL.'/css/global.css?'.AOWOW_REVISION; ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL.'/css/aowow.css?'.AOWOW_REVISION; ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL.'/css/locale_'.User::$localeString.'.css?'.AOWOW_REVISION; ?>" />
<link rel="SHORTCUT ICON" href="<?=STATIC_URL; ?>/images/logos/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="<?=STATIC_URL; ?>/download/searchplugins/aowow.xml" title="Aowow" />
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/basic.css?'.AOWOW_REVISION; ?>" />
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/global.css?'.AOWOW_REVISION; ?>" />
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/aowow.css?'.AOWOW_REVISION; ?>" />
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/locale_'.User::$localeString.'.css?'.AOWOW_REVISION; ?>" />
<?php
if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO)):
echo ' <link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/staff.css?'.AOWOW_REVISION."\" />\n";
@@ -23,22 +23,22 @@ foreach ($this->css as $css):
endforeach;
?>
<script type="text/javascript">
var g_serverTime = new Date('<?php echo date(Util::$dateFormatInternal); ?>');
var g_staticUrl = "<?php echo STATIC_URL; ?>";
var g_host = "<?php echo HOST_URL; ?>";
var g_serverTime = new Date('<?=date(Util::$dateFormatInternal); ?>');
var g_staticUrl = "<?=STATIC_URL; ?>";
var g_host = "<?=HOST_URL; ?>";
<?php
if ($this->gDataKey):
echo " var g_dataKey = '".$_SESSION['dataKey']."'\n";
endif;
?>
</script>
<script src="<?php echo STATIC_URL.'/js/jquery-1.4.2.min.js'; ?>" type="text/javascript"></script>
<script src="<?php echo STATIC_URL.'/js/basic.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?php echo STATIC_URL.'/widgets/power.js?lang='.substr(User::$localeString, 2); ?>" type="text/javascript"></script>
<script src="<?php echo STATIC_URL.'/js/locale_'.User::$localeString.'.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?php echo STATIC_URL.'/js/global.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?php echo STATIC_URL.'/js/locale.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?php echo STATIC_URL.'/js/Markup.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/js/jquery-1.4.2.min.js'; ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/js/basic.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/widgets/power.js?lang='.substr(User::$localeString, 2); ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/js/locale_'.User::$localeString.'.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/js/global.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/js/locale.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<script src="<?=STATIC_URL.'/js/Markup.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
<?php
if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO)):
echo ' <script src="'.STATIC_URL.'/js/staff.js?'.AOWOW_REVISION."\" type=\"text/javascript\"></script>\n";
@@ -51,5 +51,20 @@ foreach ($this->js as $js):
endforeach;
?>
<script type="text/javascript">
var g_user = <?php echo Util::toJSON($this->gUser, JSON_UNESCAPED_UNICODE); ?>;
var g_user = <?=Util::toJSON($this->gUser, JSON_UNESCAPED_UNICODE); ?>;
</script>
<?php
if (CFG_ANALYTICS_USER):
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<?=CFG_ANALYTICS_USER; ?>', 'auto');
ga('send', 'pageview');
</script>
<?php
endif;
?>

View File

@@ -24,7 +24,7 @@ if (!empty($this->gemScores)): // inherited from it
endif;
if ($isTabbed):
echo " var ".$tabVar." = new Tabs({parent: \$WH.ge('tabs-generic')});\n";
echo " var ".$tabVar." = new Tabs({parent: \$WH.ge('tabs-generic')".(isset($this->type) ? ", trackable: '".ucfirst(Util::$typeStrings[$this->type]."'") : null)."});\n";
endif;
foreach ($this->lvTabs as $lv):