Skip to content

Commit ca89f6a

Browse files
committed
Updates from comments
- Make text change for clarity - Replace reference to "Preserve log" with disabling the form submission
1 parent 515b268 commit ca89f6a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/ga4-tracking.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Tracking is added to Publisher via GA4. The full documentation is avaialable in [GA4 Publishing Implementation guide](https://docs.google.com/document/d/19RaqZttDTZXsgX4k87wAAOhsol1STM3iTPPPKNlXRl0/edit?tab=t.0#heading=h.eo3rk3rxuz4n).
44

5-
Via this means we are tracking:
5+
Via GA4 we are tracking:
66
- Page views
77
- Navigation
88
- Form interactions
@@ -13,10 +13,10 @@ Most of the code exists in the govuk_publishing_components gem. On publisher we
1313

1414
Tracking can be tested locally with these steps:
1515
- ensure that the "Ga4 form tracking" feature is set to "On" via FlipFlop
16-
- ensure that "Preserve log" is set to "On" in the browser console
16+
- run `document.querySelector('form').addEventListener('submit',function(e){e.preventDefault()})` in the browser console. This will disable form submissions so the full set of data from user interactions can be observed without leaving the page and saving any changes.
1717
- run `window.GOVUK.analyticsGa4.showDebug = true` in the browser console. The console will then display the tracking data for all user interactions with the form as they occur.
1818

19-
Running `window.dataLayer` in the browser console at any point will display the data that has been collected during user interactions with the page. In this work we are interested in the "event_data" events. There should be one of these for each user event with the form since the page was loaded.
19+
Running `window.dataLayer` in the browser console after performing a save will display the data that has been collected during user interactions with the page. In this work we are interested in the "event_data" events. There should be one of these for each user event with the form since the page was loaded.
2020

2121
## Automated tests
2222

0 commit comments

Comments
 (0)