From: qw3rty Date: Tue, 18 May 2010 20:30:04 +0000 (+0000) Subject: converted Google Analytics code to use asynchronous tracking X-Git-Tag: live~829 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/07ab188d70f8e090ad79090fb467b7f1c1d72ef9 converted Google Analytics code to use asynchronous tracking git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@302 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/templates/footer.html b/forum/skins/default/templates/footer.html index b92f06b..e8af78f 100644 --- a/forum/skins/default/templates/footer.html +++ b/forum/skins/default/templates/footer.html @@ -35,15 +35,17 @@ {% if settings.GOOGLE_ANALYTICS_KEY %} - + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', '{{ settings.GOOGLE_ANALYTICS_KEY }}']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; 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); + })(); + {% endif %}