diff --git a/templates/analytics.html b/templates/analytics.html
new file mode 100644
index 0000000000000000000000000000000000000000..ba174fcc20a5c04e3393a476a3dd20f7e7c29b9f
--- /dev/null
+++ b/templates/analytics.html
@@ -0,0 +1,11 @@
+{% if 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"));
+    </script>
+    <script type="text/javascript">
+    try {
+        var pageTracker = _gat._getTracker("{{GOOGLE_ANALYTICS}}");
+    pageTracker._trackPageview();
+    } catch(err) {}</script>
+{% endif %}
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
index 5cc8b82a2d964a08a744887c3318dd9454e5050a..c4e5935838e6e8cc385119c6e8950471acb64bc8 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -17,6 +17,8 @@
 
         <link rel="stylesheet" href="{{ SITEURL }}/theme/css/screen.css" type="text/css" />
         <link rel="stylesheet" href="{{ SITEURL }}/theme/css/pygments.css" type="text/css" />
+
+
     </head>
     <body>
         {% if SITENAME -%}
@@ -58,5 +60,6 @@
             </div>
             <div class="clear"></div>
         </div>
+{% include 'analytics.html' %}
     </body>
 </html>