diff --git a/docs/views/includes/analytics.html b/docs/views/includes/analytics.html
new file mode 100644
index 0000000000..20402668d0
--- /dev/null
+++ b/docs/views/includes/analytics.html
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/docs/views/includes/head.html b/docs/views/includes/head.html
index 04baa621dd..0ef31f6a59 100644
--- a/docs/views/includes/head.html
+++ b/docs/views/includes/head.html
@@ -1,17 +1,6 @@
-{% if promoMode == 'true' %}
-
-
-
+{% if promoMode == 'true' and analyticsId %}
+ {% include "includes/analytics.html" %}
{% endif %}
diff --git a/server.js b/server.js
index 647d5d11c0..725000b9ea 100644
--- a/server.js
+++ b/server.js
@@ -20,6 +20,7 @@ var password = process.env.PASSWORD
var env = process.env.NODE_ENV || 'development'
var useAuth = process.env.USE_AUTH || config.useAuth
var useHttps = process.env.USE_HTTPS || config.useHttps
+var analyticsId = process.env.ANALYTICS_TRACKING_ID
env = env.toLowerCase()
useAuth = useAuth.toLowerCase()
@@ -103,6 +104,7 @@ app.use(function (req, res, next) {
// Add variables that are available in all views
app.use(function (req, res, next) {
+ res.locals.analyticsId = analyticsId
res.locals.serviceName = config.serviceName
res.locals.cookieText = config.cookieText
res.locals.releaseVersion = 'v' + releaseVersion