diff --git a/docs/_layouts/base.html b/docs/_layouts/base.html
index 59944e2e..423edc92 100644
--- a/docs/_layouts/base.html
+++ b/docs/_layouts/base.html
@@ -9,7 +9,7 @@
-{% if site.github.source.branch != "main" or page.noindex == true %}
+{% if jekyll.environment != 'production' or page.noindex == true %}
{% endif %}
@@ -27,7 +27,7 @@
-{% if site.ga_tag and site.github.source.branch == 'main' %}
+{% if site.ga_tag and jekyll.environment == 'production' %}