diff --git a/app/assets/javascripts/surveys.js b/app/assets/javascripts/surveys.js index f0a5855c3..cfd79af09 100644 --- a/app/assets/javascripts/surveys.js +++ b/app/assets/javascripts/surveys.js @@ -28,7 +28,7 @@ '\'>Close' + '

{{title}}

' + '
' + + 'data-ga4-link=\'' + JSON.stringify({ event_name: 'navigation', type: 'survey banner', index: 1, index_total: 1, section: '{{title}}' }) + '\'>' + children + '
' + ' ' + diff --git a/spec/javascripts/surveys.spec.js b/spec/javascripts/surveys.spec.js index 4a24175e8..1491799ae 100644 --- a/spec/javascripts/surveys.spec.js +++ b/spec/javascripts/surveys.spec.js @@ -104,7 +104,7 @@ describe('Surveys', function () { var expectedGa4Auto = { event_data: { event_name: 'element_visible', type: 'survey banner' } } var expectedGa4Event = { event_name: 'select_content', type: 'survey banner', action: 'closed', section: 'Tell us what you think of GOV.UK' } - var expectedGa4Link = { event_name: 'navigation', type: 'survey banner', index: 1, index_total: 1 } + var expectedGa4Link = { event_name: 'navigation', type: 'survey banner', index: 1, index_total: 1, section: 'Tell us what you think of GOV.UK' } var expectedGa4Form = { event_name: 'form_submit', type: 'survey banner',