Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA4: Fix ecommerce tracking of searches without query #4317

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Commits on Oct 18, 2024

  1. 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.
    csutter committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    a5e958d View commit details
    Browse the repository at this point in the history