Author: fdesbois Date: 2010-05-25 13:25:38 +0000 (Tue, 25 May 2010) New Revision: 485 Log: Update google analytics java script Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml =================================================================== --- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2010-05-06 12:18:27 UTC (rev 484) +++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2010-05-25 13:25:38 UTC (rev 485) @@ -40,15 +40,18 @@ <t:unless t:test="devEnvironment"> <!-- Script for Google Analytics --> <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-12982015-1']); + _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); + })(); + </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-12982015-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> </t:unless> <div id="so-session" class="clearfix"> <div class="fleft">