From 07ab188d70f8e090ad79090fb467b7f1c1d72ef9 Mon Sep 17 00:00:00 2001 From: qw3rty Date: Tue, 18 May 2010 20:30:04 +0000 Subject: [PATCH] converted Google Analytics code to use asynchronous tracking git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@302 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/skins/default/templates/footer.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 %} -- 2.39.5