diff --git a/_includes/google-analytics.html b/_includes/google-analytics.html
index 74bbc87..b397265 100644
--- a/_includes/google-analytics.html
+++ b/_includes/google-analytics.html
@@ -6,11 +6,13 @@
MIT License
-->
-
+
diff --git a/_includes/js-selector.html b/_includes/js-selector.html
index b02e076..1fd6b9e 100644
--- a/_includes/js-selector.html
+++ b/_includes/js-selector.html
@@ -25,4 +25,10 @@
{% if jekyll.environment == 'production' %}
+
+
+ {% if site.google_analytics.id %}
+ {% include google-analytics.html %}
+ {% endif %}
+
{% endif %}
diff --git a/_layouts/default.html b/_layouts/default.html
index ad98149..4dc9dce 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -52,10 +52,6 @@ layout: compress
{% include search-loader.html %}
- {% if site.google_analytics.id and jekyll.environment == 'production' %}
- {% include google-analytics.html %}
- {% endif %}
-