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

ReactGA.ga(...args) not returning window.ga #73

Open
jcshott opened this issue May 20, 2024 · 0 comments
Open

ReactGA.ga(...args) not returning window.ga #73

jcshott opened this issue May 20, 2024 · 0 comments

Comments

@jcshott
Copy link

jcshott commented May 20, 2024

When using react-ga - we would set up the cross-domain tracking with the linker option in GA:

ex:

ReactGA.ga("require", "linker")
ReactGA.ga("linker:autoLink", ["source.com"])

When we upgraded to this library - we started getting warnings in the console:

Command doesn't exist: require
Command doesn't exist: linker:autoLink

It looks like this invocation is getting caught up here: https://github.com/codler/react-ga4/blob/master/src/ga4.js#L356-L367

whereas in the old react-ga library - this method would return window.ga
https://github.com/react-ga/react-ga/blob/087837dc03d482549ded7669ac559df0c7cc5498/src/core.js#L30

What is the correct way to migrate this function call to react-ga4?

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

No branches or pull requests

1 participant