Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load Contao Googleanalytics tracking after window load
<!-- indexer::stop -->
<!-- Google Analytics -->
<script type="text/javascript">
<!--//--><![CDATA[//><!--
window.addEvent('load', function()
{
var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');
Asset.javascript(gaJsHost + 'google-analytics.com/ga.js',
{
onload: function()
{
var pageTracker = _gat._getTracker('UA-XXXXX-X');
pageTracker._initData();
pageTracker._trackPageview();
}
});
});
//--><!]]>
</script>
<!-- End Google Analytics Tag -->
<!-- indexer::continue -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.