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

Switch from Universal Analytics to Google Analytics 4 #550

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

sunu
Copy link
Collaborator

@sunu sunu commented Oct 4, 2023

@sunu sunu marked this pull request as draft October 4, 2023 06:26
@sunu
Copy link
Collaborator Author

sunu commented Oct 4, 2023

Looks like react-ga4 is not a drop-in replacement of react-ga as some of the helper functions we use are missing. This PR needs further changes to port our code over to use react-ga4

@sunu
Copy link
Collaborator Author

sunu commented Oct 4, 2023

react-ga4 recommends using the google analytics plugin for debugging to log the events. But I couldn't get it to log anything

@vgeorge vgeorge marked this pull request as ready for review October 4, 2023 14:09
@vgeorge
Copy link
Contributor

vgeorge commented Oct 4, 2023

@sunu this is working well for me. To test it locally, add the GA tracking code to config/local.js, open devtools and inspect the outgoing request to Google Analytics. Please notice that this PR will enable GA tracking to the staging environment only. If we desire to add it to production, a tracking code must be added to config/production.js.

@vgeorge vgeorge requested a review from kamicut October 4, 2023 14:31
@sunu
Copy link
Collaborator Author

sunu commented Oct 4, 2023

@vgeorge Awesome! We should also figure out how to handle ReactGA.OutboundLink. I believe that's not defined in react-ga4?

@vgeorge vgeorge self-requested a review October 6, 2023 12:49
Copy link
Contributor

@vgeorge vgeorge left a comment

Choose a reason for hiding this comment

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

Let's address the outbound method issue in separate, it doesn't look like it is blocking this merge.

@vgeorge vgeorge merged commit 57ca4dd into develop Oct 6, 2023
14 checks passed
@vgeorge vgeorge deleted the feat/google-analytics-4 branch October 6, 2023 12:55
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