Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominikzogg/1578451 to your computer and use it in GitHub Desktop.
Save dominikzogg/1578451 to your computer and use it in GitHub Desktop.
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