% if note %>
<%= note %>
<% end %>
<%= form_with url: helpers.analytics_exhibit_dashboard_path(current_exhibit), class: 'mb-3 d-flex', method: :get do |form| %>
<%= form.label :start_date, I18n.t("spotlight.dashboards.analytics.start_date_label") %>
<%= form.date_field :start_date, value: dates['start_date'], min: min_date, max: max_date %>
<%= form.label :end_date, I18n.t("spotlight.dashboards.analytics.end_date_label"), class: 'ml-2 ms-2' %>
<%= form.date_field :end_date, value: dates['end_date'], min: min_date, max: max_date %>
<%= form.submit I18n.t("spotlight.dashboards.analytics.submit_date_label"), class: 'btn btn-primary' %>
<% end %>
<% if results? %>
<%= heading %>
<%= I18n.t("spotlight.dashboards.analytics.visitor_header") %>
<%= render Spotlight::Analytics::AggregationComponent.new(data: page_analytics.totals) %>
<%= I18n.t("spotlight.dashboards.analytics.session_header") %>
<%= render Spotlight::Analytics::AggregationComponent.new(data: search_analytics.totals, exclude_fields: [:eventCount] ) %>
<% unless page_analytics.rows.empty? %>
<%= I18n.t("spotlight.dashboards.analytics.pages.header") %>
<%= I18n.t("spotlight.dashboards.analytics.pagetitle") %> |
<%= I18n.t("spotlight.dashboards.analytics.pageviews") %> |
<% page_analytics.rows.each do |p| %>
<%= link_to p.pageTitle, p.pagePath %> |
<%= p.screenPageViews %> |
<% end %>
<% end %>
<% unless search_analytics.rows.empty? %>
<%= I18n.t("spotlight.dashboards.analytics.searches.header") %>
<%= I18n.t("spotlight.dashboards.analytics.searches.term") %> |
<%= I18n.t("spotlight.dashboards.analytics.searches.views") %> |
<% search_analytics.rows.each do |p| %>
<% if p.searchTerm.present? %>
<%= p.searchTerm %> |
<%= p.eventCount %> |
<% end %>
<% end %>
<% end %>
<% else %>
<%= I18n.t("spotlight.dashboards.analytics.no_results", pageurl: page_url) %>
<% end %>