diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2019-10-25 10:17:26 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-10-25 14:19:55 +0300 |
commit | 059e2b8f110beffe21b4159f29443c11bdf451d8 (patch) | |
tree | 6013e499528a863d506360c9d5b45f64dde5d0cc | |
parent | a14243228ac5320573676626698592013fe14367 (diff) |
Do not load any 3rd party analytics in single versions11.2
-rw-r--r-- | layouts/gtm.html | 2 | ||||
-rw-r--r-- | layouts/home.html | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/layouts/gtm.html b/layouts/gtm.html index 033a4728..65f242c4 100644 --- a/layouts/gtm.html +++ b/layouts/gtm.html @@ -1,4 +1,4 @@ -<% if ENV['NANOC_ENV'] == 'production' %> +<% if ENV['NANOC_ENV'] == 'production' and ENV['CI_COMMIT_REF_NAME'] == 'master' %> <%# Adds GTM only in production // leave this immediately after the opening the body tag%> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WZCXKT5" diff --git a/layouts/home.html b/layouts/home.html index 73c26cbd..9daafb06 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -24,7 +24,10 @@ <%= yield %> <%= render '/footer.*' %> <%= render '/docsearch.*' %> - <%= render '/analytics.*' %> + <% if ENV['NANOC_ENV'] == 'production' and ENV['CI_COMMIT_REF_NAME'] == 'master' %> + <%# Add analytics only in production %> + <%= render '/analytics.*' %> + <% end %> <%= render '/https_redirect.*' %> <%= render '/schema-microdata.*' %> </body> |