-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GA4: Fix ecommerce tracking of searches without query
The GA4 ecommerce tracking for search results doesn't currently work if the user is searching for an empty query, as the check for whether the `ga4-search-query` data attribute is present uses loose Javascript boolean logic (i.e. returning false for an empty string). This amends it to strictly check for `null` instead (data attribute not present at all), and adds some tests for the search ecommerce data being properly set with the query present and absent.
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters