From 510d5cec7be02eaffb398d7cd49d221a5c3a1c36 Mon Sep 17 00:00:00 2001
From: Alex Kiessling <ajkiessl@gmail.com>
Date: Mon, 1 Aug 2022 16:31:54 -0400
Subject: [PATCH] Moved matomo code and fetching env variable.

---
 app/views/layouts/application.html.erb   | 1 -
 app/views/shared/_header_navbar.html.erb | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index eb02e9c..941d652 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -8,7 +8,6 @@
 
     <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
     <%= javascript_importmap_tags %>
-    <%= render partial: 'shared/matomo_analytics' if ENV['HOSTNAME'].match(/^etda-ex-/).present? %>
   </head>
 
   <body>
diff --git a/app/views/shared/_header_navbar.html.erb b/app/views/shared/_header_navbar.html.erb
index 57eb0e8..c7e4dda 100644
--- a/app/views/shared/_header_navbar.html.erb
+++ b/app/views/shared/_header_navbar.html.erb
@@ -16,6 +16,7 @@
       <%= render 'shared/user_util_links' %>
     </div>
   </div>
+  <%= render partial: 'shared/matomo_analytics' if ENV.fetch('HOSTNAME', 'dev').match(/^etda-ex-/).present? %>
 </nav>
 
 <%= content_tag :div, class: 'navbar-search navbar navbar-light bg-light', role: 'navigation', aria: { label: t('blacklight.search.header') } do %>