Hallo Leute,
bei meiner Contao 3 -> 4 migrierten Version habe ich noch das alte Template analytics_google.html5.
Hab davon ne Kopie gemacht und bei der Seite www.life-eurokite.at eingebunden im Seitenlayout. Bei Google Analytics hab ich ne neue Tracking Id angelegt und in der Kopie eingetragen. Allerdings sehe ich kein Tracking von mir, auch nicht wen ich private Browser die Seite aufmache bzw. am Handy.
Interessanterweise habe ich jetzt allerdings ein paar Zugriffe aus China laut Google Analytics.
Bei ner frischen Contao4 Installation habe ich gesehen da gibt es gar keine Google Analytics Template mehr. Wie geht man hier vor?
Danke euch!
Unterhalb mein altes Analytics Template.
PHP-Code:
<?php
/**
* To use this script, please fill in your Google Analytics ID below
* UA-169149865-1 - Life Eurokite
*/
$GoogleAnalyticsId = 'UA-169149865-1';
/**
* DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
*/
if ($GoogleAnalyticsId != 'UA-XXXXX-X' && !BE_USER_LOGGED_IN && sha1(session_id() . (!$GLOBALS['TL_CONFIG']['disableIpCheck'] ? Environment::get('ip') : '') . 'BE_USER_AUTH') != Input::cookie('BE_USER_AUTH')): ?>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo $GoogleAnalyticsId; ?>']);
<?php if ($GLOBALS['TL_CONFIG']['privacyAnonymizeGA']): ?>
_gaq.push(['_gat._anonymizeIp']);
<?php endif; ?>
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); 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>
<?php endif; ?>
Lesezeichen