Skip to content

Main 7426 edit page add amend ga4#3314

Merged
davidtrussler merged 2 commits into
mainfrom
MAIN-7426_Edit-page_Add-amend-GA4
May 22, 2026
Merged

Main 7426 edit page add amend ga4#3314
davidtrussler merged 2 commits into
mainfrom
MAIN-7426_Edit-page_Add-amend-GA4

Conversation

@davidtrussler
Copy link
Copy Markdown
Contributor

@davidtrussler davidtrussler commented May 20, 2026

MAIN-7426

Adds the relevant tracking to the Edit page for Guide Editions. The addition of this page required tracking to be added to the accordion section controls as detailed in the Jira ticket and shown in the screenshots below.

Much of the tracking is already in place so this PR

  • adds some tests for all the user interactions with the relevant elements on the page
  • adds some data-attributes to the view to provide the correct values to be tracked

Tracking can be tested locally with these steps:

  • run document.querySelector('form').addEventListener('submit',function(e){e.preventDefault()}) in the browser console. This will disable the form submission so that all data gathered from user interaction with the form, including submission, will be visible in the console.
  • run document.addEventListener('click',function(e){if(e.target.href)(e.preventDefault())}) in the browser console. This will disable links from navigating away from the page so that all data gathered from user interaction with the form will be visible in the console.
  • run window.GOVUK.analyticsGa4.showDebug = true in the browser console. The browser console will then display the tracking data for all user interactions with the form (including submission) as they occur.
Screenshot 2026-05-20 at 17 58 56 Screenshot 2026-05-20 at 18 03 42

- enable GA4 on `accordion` component
- add `data-attributes` to "Add new chapter" link
@davidtrussler davidtrussler force-pushed the MAIN-7426_Edit-page_Add-amend-GA4 branch from 1b30d1f to 6bf2881 Compare May 20, 2026 15:51
@davidtrussler davidtrussler marked this pull request as ready for review May 20, 2026 17:16
Copy link
Copy Markdown
Contributor

@young-rob young-rob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@davidtrussler davidtrussler merged commit 72f5851 into main May 22, 2026
12 checks passed
@davidtrussler davidtrussler deleted the MAIN-7426_Edit-page_Add-amend-GA4 branch May 22, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants