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

MPP-3762: Handle order issue with useGoogleAnalytics #4453

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

jwhitlock
Copy link
Member

In some cases (such as npn dev:mocked, or occasionally in the browser), the function initGoogleAnalytics is run before useGoogleAnalytics has replaced globalEnableGoogleAnalytics. This changes globalEnableGoogleAnalytics to start with a default of null. When it is not yet a function, gaIsInitialized is changed instead, to provide a default of true for the singletonHook.

In some cases (such as npn dev:mocked, or occasionally in the browser),
the function initGoogleAnalytics is run before useGoogleAnalytics has
replaced globalEnableGoogleAnalytics. This changes
globalEnableGoogleAnalytics to start with a default of null. When it is
not yet a function, gaIsInitialized is changed instead, to provide a
default of True for the singletonHook.
Copy link
Contributor

@rafeerahman rafeerahman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, this fixes the inconsistency

@jwhitlock jwhitlock added this pull request to the merge queue Feb 28, 2024
Merged via the queue into main with commit 227697a Feb 28, 2024
27 checks passed
@jwhitlock jwhitlock deleted the fix-early-ga-mpp-3762 branch February 28, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants