diff --git a/app/assets/javascripts/admin/analytics-modules/ga4-button-setup.js b/app/assets/javascripts/admin/analytics-modules/ga4-button-setup.js index 6369d25ea42..6e33a2baefc 100644 --- a/app/assets/javascripts/admin/analytics-modules/ga4-button-setup.js +++ b/app/assets/javascripts/admin/analytics-modules/ga4-button-setup.js @@ -15,8 +15,7 @@ window.GOVUK.analyticsGa4.analyticsModules = const event = { event_name: 'navigation', type: 'button', - text: button.textContent, - method: 'primary_click' + text: button.textContent } if (button.dataset.ga4Event) { Object.assign(event, JSON.parse(button.dataset.ga4Event)) diff --git a/app/assets/javascripts/admin/analytics-modules/ga4-link-setup.js b/app/assets/javascripts/admin/analytics-modules/ga4-link-setup.js index 34f59ea044c..aa663904dd5 100644 --- a/app/assets/javascripts/admin/analytics-modules/ga4-link-setup.js +++ b/app/assets/javascripts/admin/analytics-modules/ga4-link-setup.js @@ -14,8 +14,7 @@ window.GOVUK.analyticsGa4.analyticsModules = links.forEach((link) => { const event = { event_name: 'navigation', - type: link.role === 'button' ? 'button' : 'generic_link', - method: 'primary_click' + type: link.role === 'button' ? 'button' : 'generic_link' } if (link.dataset.ga4Event) { Object.assign(event, JSON.parse(link.dataset.ga4Event)) diff --git a/spec/javascripts/admin/analytics-modules/ga4-button-setup.spec.js b/spec/javascripts/admin/analytics-modules/ga4-button-setup.spec.js index a3891991730..4fa0cac69ae 100644 --- a/spec/javascripts/admin/analytics-modules/ga4-button-setup.spec.js +++ b/spec/javascripts/admin/analytics-modules/ga4-button-setup.spec.js @@ -18,7 +18,7 @@ describe('GOVUK.analyticsGa4.analyticsModules', function () { ga4ButtonSetup.init() expect(button.dataset.ga4Event).toEqual( - '{"event_name":"navigation","type":"button","text":"Button","method":"primary_click"}' + '{"event_name":"navigation","type":"button","text":"Button"}' ) }) @@ -29,7 +29,7 @@ describe('GOVUK.analyticsGa4.analyticsModules', function () { ga4ButtonSetup.init() expect(button.dataset.ga4Event).toEqual( - '{"event_name":"navigation","type":"button","text":"Button","method":"primary_click"}' + '{"event_name":"navigation","type":"button","text":"Button"}' ) }) @@ -42,7 +42,7 @@ describe('GOVUK.analyticsGa4.analyticsModules', function () { ga4ButtonSetup.init() expect(button.dataset.ga4Event).toEqual( - '{"event_name":"custom_event_name","type":"button","text":"Button","method":"primary_click"}' + '{"event_name":"custom_event_name","type":"button","text":"Button"}' ) }) }) diff --git a/spec/javascripts/admin/analytics-modules/ga4-link-setup.spec.js b/spec/javascripts/admin/analytics-modules/ga4-link-setup.spec.js index 5980855374e..0b393661625 100644 --- a/spec/javascripts/admin/analytics-modules/ga4-link-setup.spec.js +++ b/spec/javascripts/admin/analytics-modules/ga4-link-setup.spec.js @@ -17,7 +17,7 @@ describe('GOVUK.analyticsGa4.analyticsModules.Ga4LinkSetup', function () { Ga4LinkSetup.init() expect(link.dataset.ga4Event).toEqual( - '{"event_name":"navigation","type":"generic_link","method":"primary_click"}' + '{"event_name":"navigation","type":"generic_link"}' ) }) @@ -28,7 +28,7 @@ describe('GOVUK.analyticsGa4.analyticsModules.Ga4LinkSetup', function () { Ga4LinkSetup.init() expect(link.dataset.ga4Event).toEqual( - '{"event_name":"navigation","type":"button","method":"primary_click"}' + '{"event_name":"navigation","type":"button"}' ) }) })