Fix missing form names in Google Analytics #2259
Merged
+101
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this pull request solve?
Trello card: https://trello.com/c/b6jmnphx/2288-track-branching-validation-errors
Our code for tracking validation errors in Google Analytics was returning null for the form name in many cases.
This is because the analytics logic was getting the form name from the input if it had
form
as an attribute, but some input objects - mainly those that change the page model - don't have theform
attribute as they operate ondraft_question
instead.This PR:
Pages::RoutingPageInput
to use aform
attribute so it can be read by the analytics.Testing instructions
analytics_enabled: true
in your local settings (this isn't set in the review environment)dataLayer
Things to consider when reviewing