Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah German <sgerman@gitlab.com>2023-06-01 16:46:34 +0300
committerSarah German <sgerman@gitlab.com>2023-06-01 16:46:34 +0300
commitbf0b5c6ccac3628ecb29587a9ef7a34ec4f1a849 (patch)
tree5fdd1c1d1926ef20db1184972238a6bcd1afe3c9
parent82ed5638dcb552b659993ad47b729afacd8ae8cc (diff)
parent7434d4e8ec36b2bbe814576b23d34487ed861bfc (diff)
Merge branch 'cherry-pick-69942af7-fixed-conflicts' into '15.7'15.7
Load the analytics only in the main site (15.7 backport) See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3904 Merged-by: Sarah German <sgerman@gitlab.com> Approved-by: Sarah German <sgerman@gitlab.com> Co-authored-by: Achilleas Pipinellis <axil@gitlab.com>
-rw-r--r--layouts/404.html4
-rw-r--r--layouts/analytics.html2
-rw-r--r--layouts/default.html4
-rw-r--r--layouts/gtm.html2
-rw-r--r--layouts/head.html16
-rw-r--r--layouts/home.html4
-rw-r--r--layouts/search.html4
7 files changed, 14 insertions, 22 deletions
diff --git a/layouts/404.html b/layouts/404.html
index f638d150..73677a4b 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -17,9 +17,7 @@
</section>
<script src="<%= @items['/frontend/shared/global_imports.*'].path %>"></script>
- <% if production? %>
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
</body>
</html>
diff --git a/layouts/analytics.html b/layouts/analytics.html
index 3f8a9985..f18097f5 100644
--- a/layouts/analytics.html
+++ b/layouts/analytics.html
@@ -1,3 +1,4 @@
+<% if production_and_default_branch? %>
<!-- Facebook -->
<script src="<%= @items['/assets/javascripts/facebook_analytics.*'].path %>"></script>
<noscript><img height="1" width="1" style="display:none"
@@ -19,3 +20,4 @@ src="https://www.facebook.com/tr?id=1689559637958103&ev=PageView&noscript=1"
<noscript>
<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=30694&fmt=gif" />
</noscript>
+<% end %>
diff --git a/layouts/default.html b/layouts/default.html
index 2e81869c..038430f9 100644
--- a/layouts/default.html
+++ b/layouts/default.html
@@ -107,10 +107,8 @@
<script src="<%= @items['/frontend/default/mermaid.*'].path %>"></script>
<% end %>
- <% if production? %>
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
<% if @item.identifier.to_s == '/ee/update/deprecations.md' %>
<script src="<%= @items['/frontend/deprecations/filters.*'].path %>"></script>
<% end %>
diff --git a/layouts/gtm.html b/layouts/gtm.html
index 3361f413..bbeb2c59 100644
--- a/layouts/gtm.html
+++ b/layouts/gtm.html
@@ -1,4 +1,4 @@
-<% if production? and ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] %>
+<% if production_and_default_branch? %>
<%# 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-NJXWQL"
diff --git a/layouts/head.html b/layouts/head.html
index 26ca5f2f..804dd0bc 100644
--- a/layouts/head.html
+++ b/layouts/head.html
@@ -44,19 +44,17 @@
<link rel="stylesheet" href="<%= @items['/assets/stylesheets/font-awesome.min.*'].path %>">
<% if production? %>
- <%# Adds GTM only in production %>
- <!-- add cookie consent -->
- <script type="text/javascript" src="https://cdn.cookielaw.org/consent/7f944245-c5cd-4eed-a90e-dd955adfdd08/OtAutoBlock.js">
- </script>
-
- <script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="7f944245-c5cd-4eed-a90e-dd955adfdd08">
- </script>
-
+ <!-- OneTrust Cookies Consent Notice start -->
+ <script src="https://cdn.cookielaw.org/consent/7f944245-c5cd-4eed-a90e-dd955adfdd08/OtAutoBlock.js"></script>
+ <script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" charset="UTF-8" data-domain-script="7f944245-c5cd-4eed-a90e-dd955adfdd08"></script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>
+ <!-- OneTrust Cookies Consent Notice end -->
+<% end %>
-
+<% if production_and_default_branch? %>
+ <%# Adds GTM only in production %>
<!-- Google Tag Manager -->
<script src="<%= @items['/assets/javascripts/google_tagmanager.*'].path %>"></script>
<!-- End Google Tag Manager -->
diff --git a/layouts/home.html b/layouts/home.html
index c573033d..848e4f10 100644
--- a/layouts/home.html
+++ b/layouts/home.html
@@ -8,10 +8,8 @@
<%= render '/gtm.*' %>
<%= render '/header.*' %>
<%= yield %>
- <% if production? and ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] %>
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
<%= render '/schema-microdata.*' %>
<script src="<%= @items['/frontend/header/index.*'].path %>"></script>
<script src="<%= @items['/frontend/shared/global_imports.*'].path %>"></script>
diff --git a/layouts/search.html b/layouts/search.html
index 9d33e0b8..e5be9567 100644
--- a/layouts/search.html
+++ b/layouts/search.html
@@ -31,10 +31,8 @@
<script src="<%= @items['/frontend/shared/global_imports.*'].path %>"></script>
<script src="<%= @items['/frontend/header/index.*'].path %>"></script>
- <% if production? %>
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
<%= render '/schema-microdata.*' %>
</body>
</html>