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

Update ga.tsxUpdate ga.tsx to support standalone usage of sendGAEvent #70804

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Commits on Oct 4, 2024

  1. Update ga.tsxUpdate ga.tsx to support standalone usage of sendGAEvent

    The current implementation prevents the sendGAEvent function from being used if Google Tag Manager is imported with a custom script and not with the GoogleAnalytics function, this is because the currDataLayerName variable is initialized to undefined and initialized to “dataLayer” (or a string passed in as prop) only in the GoogleAnalytics function and, in the sendGAEvent function, it is checked to see if that value is undefined and, if so, a warning is triggered. By using the sendGAEvent function standalone, it is impossible for the currDataLayerName variable to be initialized and so the warning always starts, preventing its use.
    LorenzoGalassi authored Oct 4, 2024
    Configuration menu
    Copy the full SHA
    7711dde View commit details
    Browse the repository at this point in the history