From 1da75a9fe77854411661ea0fb845388240fdb588 Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Mon, 11 Dec 2023 16:21:34 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Tighten=20tenant=20GA=20ID=20log?= =?UTF-8?q?ic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `#current_account` method returns a tenant instance when on the proprietor page (not in a tenant subdomain). This then looks for a `HYKU_GOOGLE_ANALYTICS_ID` instead of the `GOOGLE_ANALYTICS_ID` env variable. We want to only use the `GOOGLE_ANALYTICS_ID`. Ref: - https://github.com/scientist-softserv/palni-palci/issues/910 --- app/views/shared/_ga4.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_ga4.html.erb b/app/views/shared/_ga4.html.erb index a533dd4e2..b4959c807 100644 --- a/app/views/shared/_ga4.html.erb +++ b/app/views/shared/_ga4.html.erb @@ -1,6 +1,7 @@ <%# OVERRIDE Hyrax 3.5.0 to handle multitenancy %> -<% ids = [Settings.google_analytics_id, current_account.google_analytics_id].compact.reject(&:empty?).uniq %> +<% tenant_ga_id = current_account.google_analytics_id if current_account.id %> +<% ids = [Settings.google_analytics_id, tenant_ga_id].compact.reject(&:empty?).uniq %>