From 8a4dbf22fa72aaf13b3eaa53056de0752d4c1a41 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Fri, 22 Sep 2023 15:18:33 +0100 Subject: [PATCH] Change GA4 contents list type - change GA4 attributes for the contents list component from type 'content' to type 'contents list' --- CHANGELOG.md | 1 + .../components/_contents_list.html.erb | 2 +- spec/components/contents_list_spec.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72d0042e7b..34020ca2c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ## Unreleased +* Change GA4 contents list type ([PR #3635](https://github.com/alphagov/govuk_publishing_components/pull/3635)) * Change prev and next GA4 type ([PR #3631](https://github.com/alphagov/govuk_publishing_components/pull/3631)) * Remove timestamps from GA4 video urls ([PR #3632](https://github.com/alphagov/govuk_publishing_components/pull/3632)) * Add stylistic plugin for stylelint ([PR #3629](https://github.com/alphagov/govuk_publishing_components/pull/3629)) diff --git a/app/views/govuk_publishing_components/components/_contents_list.html.erb b/app/views/govuk_publishing_components/components/_contents_list.html.erb index a02092df8d..4e8f98e30e 100644 --- a/app/views/govuk_publishing_components/components/_contents_list.html.erb +++ b/app/views/govuk_publishing_components/components/_contents_list.html.erb @@ -15,7 +15,7 @@ ga4_tracking ||= false ga4_data = { event_name: "navigation", - type: "content", + type: "contents list", section: t("components.contents_list.contents", locale: :en) || "" } if ga4_tracking local_assigns[:aria] ||= {} diff --git a/spec/components/contents_list_spec.rb b/spec/components/contents_list_spec.rb index b0f2d4533c..8e5769eeba 100644 --- a/spec/components/contents_list_spec.rb +++ b/spec/components/contents_list_spec.rb @@ -130,7 +130,7 @@ def assert_tracking_link(name, value, total = 1) expected_ga4_json = { event_name: "navigation", - type: "content", + type: "contents list", section: "Contents", }