Skip to content

Commit

Permalink
Merge pull request #944 from scientist-softserv/i910-tighten-tenant-g…
Browse files Browse the repository at this point in the history
…a-id-logic

🧹 Tighten tenant GA ID logic
  • Loading branch information
kirkkwang authored Dec 12, 2023
2 parents 2e9dc6c + 1da75a9 commit 5ae6463
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/shared/_ga4.html.erb
Original file line number Diff line number Diff line change
@@ -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 %>
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= ids.first %>"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand Down

0 comments on commit 5ae6463

Please sign in to comment.