Do-not-track

This commit is contained in:
mmk2410 2016-02-16 14:16:20 +01:00
parent bd28332252
commit 5d041ff6f8
1 changed files with 8 additions and 6 deletions

View File

@ -26,9 +26,10 @@
*/
if ($bloganalytics) { // check if google analytics is enabled
?>
<script>
if ($bloganalytics) { // check if google analytics is enabled
if (!($_SERVER['HTTP_DNT'] == 1)) {
?>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
@ -36,7 +37,7 @@ if ($bloganalytics) { // check if google analytics is enabled
(i[r].q = i[r].q || []).push(arguments);
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
@ -45,8 +46,9 @@ if ($bloganalytics) { // check if google analytics is enabled
ga('create', '<?php echo $bloganalytics; ?>', 'auto');
ga('send', 'pageview');
</script>
</script>
<?php
<?php
}
}
?>