Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Async google analytics

  • Loading branch information...
commit d8392249c80d4cd174912fb129914ec6c857ac62 1 parent d8f116e
Kim Ahlström authored
Showing with 12 additions and 10 deletions.
  1. +12 −10 root/flavour/www/includes/page.tt
View
22 root/flavour/www/includes/page.tt
@@ -22,6 +22,18 @@
</head>
<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>
<h1 id="logo"><strong><? c.config.site_name ?></strong> <small> — Online Japanese dictionary</small></h1>
<? process 'flavour/www/includes/menu.tt' ?>
@@ -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/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>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.