Skip to content

Commit

Permalink
Merge pull request #3691 from alphagov/ga4-fix-search-empty-bug
Browse files Browse the repository at this point in the history
Fix bug when forms with data-ga4-form-no-answer-undefined are submitted
  • Loading branch information
AshGDS authored Oct 26, 2023
2 parents 7fe224b + a780c9c commit 09c0632
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
var formData = this.getInputValues(formInputs)
data.text = data.text || this.combineGivenAnswers(formData) || this.useFallbackValue

if (data.action === 'search') {
if (data.action === 'search' && data.text) {
data.text = data.text.toLowerCase()
data.text = window.GOVUK.analyticsGa4.core.trackFunctions.removeLinesAndExtraSpaces(data.text)
}
Expand Down

0 comments on commit 09c0632

Please sign in to comment.