Skip to content

Commit

Permalink
Async google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Ahlström committed Jan 25, 2010
1 parent d8f116e commit d839224
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions root/flavour/www/includes/page.tt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
</head> </head>


<body id="page_<? c.stash.page ?>"> <body id="page_<? c.stash.page ?>">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-63389-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';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</script>

<div id="top"><a name="top"></a> <div id="top"><a name="top"></a>
<h1 id="logo"><strong><? c.config.site_name ?></strong> <small> — Online Japanese dictionary</small></h1> <h1 id="logo"><strong><? c.config.site_name ?></strong> <small> — Online Japanese dictionary</small></h1>
<? process 'flavour/www/includes/menu.tt' ?> <? process 'flavour/www/includes/menu.tt' ?>
Expand Down Expand Up @@ -111,15 +123,5 @@


<script type="text/javascript" charset="utf-8" src="/static/js/jquery.v5.js"></script> <script type="text/javascript" charset="utf-8" src="/static/js/jquery.v5.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/js/jisho.v9.js"></script> <script type="text/javascript" charset="utf-8" src="/static/js/jisho.v9.js"></script>

<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"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-63389-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</body> </body>
</html> </html>

0 comments on commit d839224

Please sign in to comment.