diff --git a/app/helpers/topic_list_helper.rb b/app/helpers/topic_list_helper.rb index 30c8d95c5..d9c933532 100644 --- a/app/helpers/topic_list_helper.rb +++ b/app/helpers/topic_list_helper.rb @@ -20,9 +20,8 @@ def topic_list_tracking_attributes(list_count, list_index, category) def topic_list_params(list, tracking_attributes: nil, list_index: nil, category: nil, list_count: nil, list_title: nil) tracking_attributes ||= topic_list_tracking_attributes(list.count, list_index, category) ga4_data = {} - ga4_data[:index] = {} - ga4_data[:index][:index_section] = list_index + 1 if list_index - ga4_data[:index][:index_section_count] = list_count if list_count + ga4_data[:index_section] = list_index + 1 if list_index + ga4_data[:index_section_count] = list_count if list_count ga4_data[:section] = list_title if list_title { diff --git a/app/presenters/taxon_organisations_presenter.rb b/app/presenters/taxon_organisations_presenter.rb index cb942f154..cc111defd 100644 --- a/app/presenters/taxon_organisations_presenter.rb +++ b/app/presenters/taxon_organisations_presenter.rb @@ -79,11 +79,9 @@ def data_attributes(base_path, link_text, index) ga4_link: { event_name: "navigation", type: "organisation logo", - index: { - index_link: index, - index_section: @index_section, - index_section_count: @index_section_count, - }, + index_link: index, + index_section: @index_section, + index_section_count: @index_section_count, index_total: organisations.count, section: "Organisations", }, diff --git a/app/presenters/taxon_presenter.rb b/app/presenters/taxon_presenter.rb index 278a77be5..f2b9296f7 100644 --- a/app/presenters/taxon_presenter.rb +++ b/app/presenters/taxon_presenter.rb @@ -39,11 +39,9 @@ def options_for_child_taxon(index:) ga4_link: { event_name: "navigation", type: "subtopic list", - index: { - index_link: (index + 1).to_s, - index_section: page_section_total.to_s, - index_section_count: page_section_total.to_s, - }, + index_link: (index + 1).to_s, + index_section: page_section_total.to_s, + index_section_count: page_section_total.to_s, index_total: child_taxons.count, section: I18n.t("taxons.explore_sub_topics", locale: :en), }, diff --git a/app/views/browse/index.html.erb b/app/views/browse/index.html.erb index 2740da26d..c9566a1b4 100644 --- a/app/views/browse/index.html.erb +++ b/app/views/browse/index.html.erb @@ -48,9 +48,7 @@ ga4_link: { event_name: "navigation", type: "browse card", - index: { - index_link: index + 1, - }, + index_link: index + 1, index_total: total_links, }, } diff --git a/app/views/browse/show.html.erb b/app/views/browse/show.html.erb index ffc0a5a73..dcbdf6b63 100644 --- a/app/views/browse/show.html.erb +++ b/app/views/browse/show.html.erb @@ -67,9 +67,7 @@ ga4_link: { event_name: "navigation", type: "browse card", - index: { - index_link: index + 1, - }, + index_link: index + 1, index_total: total_links, }, }, diff --git a/app/views/components/_topic_list.html.erb b/app/views/components/_topic_list.html.erb index 65ed3b3cb..af351caca 100644 --- a/app/views/components/_topic_list.html.erb +++ b/app/views/components/_topic_list.html.erb @@ -18,21 +18,19 @@ <%= tag.ul(class: ul_classes, lang: "en") do %> <% items.each_with_index do |item, index| %>
<%= I18n.t("world_location_news.no_updates") %>
<% end %> -