diff --git a/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb b/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb index d1f95a19a1..82744b3584 100644 --- a/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +++ b/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb @@ -5,7 +5,7 @@ module Analytics class CollectionReportsController < AnalyticsController include Hyrax::BreadcrumbsForCollectionAnalytics def index - return unless Hyrax.config.analytics? + return unless Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' @pageviews = Hyrax::Analytics.daily_events('collection-page-view') @work_page_views = Hyrax::Analytics.daily_events('work-in-collection-view') @@ -21,7 +21,7 @@ def index end def show - return unless Hyrax.config.analytics? + return unless Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' @document = ::SolrDocument.find(params[:id]) @pageviews = Hyrax::Analytics.daily_events_for_id(@document.id, 'collection-page-view') @work_page_views = Hyrax::Analytics.daily_events_for_id(@document.id, 'work-in-collection-view') diff --git a/app/controllers/hyrax/admin/analytics/work_reports_controller.rb b/app/controllers/hyrax/admin/analytics/work_reports_controller.rb index 4e5306e36b..3ae9558061 100644 --- a/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +++ b/app/controllers/hyrax/admin/analytics/work_reports_controller.rb @@ -6,7 +6,7 @@ class WorkReportsController < AnalyticsController include Hyrax::BreadcrumbsForWorksAnalytics def index - return unless Hyrax.config.analytics? + return unless Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' @accessible_works ||= accessible_works @accessible_file_sets ||= accessible_file_sets diff --git a/app/views/hyrax/admin/analytics/collection_reports/index.html.erb b/app/views/hyrax/admin/analytics/collection_reports/index.html.erb index 2f48cb57e3..1fcd4b5474 100644 --- a/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +++ b/app/views/hyrax/admin/analytics/collection_reports/index.html.erb @@ -8,7 +8,7 @@
-<% if Hyrax.config.analytics? %> +<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<%= t('.repo_summary') %> <%= pluralize(Collection.count, "collection") %>, <%= t('.repo_summary_2') %> <%= @pageviews.all %> <%= t('.views') %> <%= t('.and') %> <%= @downloads.all %> <%= t('.downloads') %>.
diff --git a/app/views/hyrax/admin/analytics/work_reports/index.html.erb b/app/views/hyrax/admin/analytics/work_reports/index.html.erb index 906eb1cbc5..0572591297 100644 --- a/app/views/hyrax/admin/analytics/work_reports/index.html.erb +++ b/app/views/hyrax/admin/analytics/work_reports/index.html.erb @@ -9,7 +9,7 @@
- <% if Hyrax.config.analytics? %> + <% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %> <% if current_user.ability.admin? %>
<%= @works_count %> <%= t('.works') %> <%= t('.repo_summary') %> <%= @pageviews.all if @pageviews %> <%= t('.views') %> <%= t('.and') %> <%= @downloads.all if @downloads %> <%= t('.downloads') %>.
<% else %> diff --git a/app/views/hyrax/base/_show_actions.html.erb b/app/views/hyrax/base/_show_actions.html.erb index 410ea20584..a8946db4ed 100644 --- a/app/views/hyrax/base/_show_actions.html.erb +++ b/app/views/hyrax/base/_show_actions.html.erb @@ -17,7 +17,7 @@ class: presenter.display_unfeature_link? ? 'btn btn-default' : 'btn btn-default collapse' %> <% end %> <% end %> - <% if Hyrax.config.analytics? %> + <% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %> <% # turbolinks needs to be turned off or the page will use the cache and the %> <% # analytics graph will not show unless the page is refreshed. %> <%= link_to t('.analytics'), presenter.stats_path, id: 'stats', class: 'btn btn-default', data: { turbolinks: false } %> diff --git a/app/views/hyrax/base/_work_button_row.html.erb b/app/views/hyrax/base/_work_button_row.html.erb index 11a4f219a9..31dfcaabf6 100644 --- a/app/views/hyrax/base/_work_button_row.html.erb +++ b/app/views/hyrax/base/_work_button_row.html.erb @@ -37,7 +37,7 @@ data: { behavior: 'unfeature' }, class: presenter.display_feature_link? ? 'btn btn-default collapse' : 'btn btn-default' %> <% end %> - <% if Hyrax.config.analytics? %> + <% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %> <%= link_to t(".analytics"), presenter.stats_path, id: 'stats', class: 'btn btn-default' %> <% end %>
diff --git a/app/views/hyrax/dashboard/_user_activity.html.erb b/app/views/hyrax/dashboard/_user_activity.html.erb index 46bdc10c07..c1fb5937aa 100644 --- a/app/views/hyrax/dashboard/_user_activity.html.erb +++ b/app/views/hyrax/dashboard/_user_activity.html.erb @@ -2,7 +2,7 @@

<%= t('.title') %>

- <% if Hyrax.config.analytics? %> + <% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %> <%= render 'user_activity_graph' %>
diff --git a/app/views/hyrax/dashboard/show_admin.html.erb b/app/views/hyrax/dashboard/show_admin.html.erb index 2fe0fdaccc..c9b23e9387 100644 --- a/app/views/hyrax/dashboard/show_admin.html.erb +++ b/app/views/hyrax/dashboard/show_admin.html.erb @@ -2,7 +2,7 @@

<%= t("hyrax.dashboard.title") %>

<% end %> -<% if Hyrax.config.analytics? %> +<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
diff --git a/app/views/hyrax/dashboard/sidebar/_activity.html.erb b/app/views/hyrax/dashboard/sidebar/_activity.html.erb index a647c611bb..eb4448f282 100644 --- a/app/views/hyrax/dashboard/sidebar/_activity.html.erb +++ b/app/views/hyrax/dashboard/sidebar/_activity.html.erb @@ -32,7 +32,7 @@ <% end %> <% end %> - <% if current_ability.can_create_any_work? && Hyrax.config.analytics? %> + <% if current_ability.can_create_any_work? && Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
  • <%= menu.collapsable_section t('hyrax.admin.sidebar.analytics'), icon_class: "fa fa-pie-chart", diff --git a/app/views/hyrax/file_sets/_show_actions.html.erb b/app/views/hyrax/file_sets/_show_actions.html.erb index 4d9251da47..f33991f3d3 100644 --- a/app/views/hyrax/file_sets/_show_actions.html.erb +++ b/app/views/hyrax/file_sets/_show_actions.html.erb @@ -1,5 +1,5 @@
    - <% if Hyrax.config.analytics? %> + <% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %> <% # turbolinks needs to be turned off or the page will use the cache and the %> <% # analytics graph will not show unless the page is refreshed. %> <%= link_to t('.analytics'), @presenter.stats_path, id: 'stats', class: 'btn btn-default', data: { turbolinks: false } %>