From 5ca4c6871dd596babf43f88792495ea30e5a399a Mon Sep 17 00:00:00 2001 From: Christian Sutter Date: Wed, 30 Oct 2024 12:09:29 +0000 Subject: [PATCH] Use new GA4 search tracker in layout super nav header --- CHANGELOG.md | 2 +- .../_layout_super_navigation_header.html.erb | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e93d0755b9..9e0f9235d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ## Unreleased * Chart component accessibility improvements ([PR #4344](https://github.com/alphagov/govuk_publishing_components/pull/4344)) -* Add new custom analytics tracker for search ([PR #4354](https://github.com/alphagov/govuk_publishing_components/pull/4354))) +* Add new custom analytics tracker for search and use in layout super nav header ([PR #4354](https://github.com/alphagov/govuk_publishing_components/pull/4354)) ## 44.9.1 diff --git a/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb b/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb index 3042495d5e..a4dfae7a1e 100644 --- a/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +++ b/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb @@ -303,18 +303,12 @@ class: "gem-c-layout-super-navigation-header__search-form", id: "search", data: { - module: "ga4-form-tracker", - ga4_form: { - event_name: "search", - type: "header menu bar", - section: "Search GOV.UK", - action: "search", - url: "/search/all", - index_section: 3, - index_section_count: 3, - }, - ga4_form_include_text: "", - ga4_form_no_answer_undefined: "", + module: "ga4-search-tracker", + ga4_search_type: "header menu bar", + ga4_search_url: "/search/all", + ga4_search_section: "Search GOV.UK", + ga4_search_index_section: 3, + ga4_search_index_section_count: 3, }, action: absolute_links_helper.make_url_absolute("/search/all"), method: "get",