From c5c75832881c28a1b0ea0aa660a7e9f54d007f57 Mon Sep 17 00:00:00 2001 From: Christian Sutter Date: Wed, 6 Nov 2024 11:53:11 +0000 Subject: [PATCH] Amend GA4 schema with new keys for autocomplete These have been agreed on for the autocomplete tracking. --- .../analytics-ga4/ga4-schemas.js | 4 +++- .../analytics-ga4/ga4-schemas.spec.js | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js b/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js index ce2910334a..1143485392 100644 --- a/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js +++ b/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js @@ -31,7 +31,9 @@ percent_scrolled: this.undefined, video_current_time: this.undefined, length: this.undefined, - video_percent: this.undefined + video_percent: this.undefined, + autocomplete_input: this.undefined, + autocomplete_suggestions: this.undefined } } } diff --git a/spec/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.spec.js b/spec/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.spec.js index 5d368292e2..60140eff64 100644 --- a/spec/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.spec.js +++ b/spec/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.spec.js @@ -41,7 +41,9 @@ describe('Google Analytics schemas', function () { percent_scrolled: undefined, video_current_time: undefined, length: undefined, - video_percent: undefined + video_percent: undefined, + autocomplete_input: undefined, + autocomplete_suggestions: undefined } } var returned = schemas.mergeProperties(data, 'example') @@ -76,7 +78,9 @@ describe('Google Analytics schemas', function () { percent_scrolled: undefined, video_current_time: undefined, length: undefined, - video_percent: undefined + video_percent: undefined, + autocomplete_input: undefined, + autocomplete_suggestions: undefined } } var returned = schemas.mergeProperties(data, 'example') @@ -111,7 +115,9 @@ describe('Google Analytics schemas', function () { percent_scrolled: undefined, video_current_time: undefined, length: undefined, - video_percent: undefined + video_percent: undefined, + autocomplete_input: undefined, + autocomplete_suggestions: undefined } } var returned = schemas.mergeProperties(data, 'example') @@ -147,7 +153,9 @@ describe('Google Analytics schemas', function () { percent_scrolled: undefined, video_current_time: undefined, length: undefined, - video_percent: undefined + video_percent: undefined, + autocomplete_input: undefined, + autocomplete_suggestions: undefined } } var returned = schemas.mergeProperties(data, 'example')