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

Port analytics to GA4 #318

Merged
merged 1 commit into from
Jun 18, 2023
Merged

Port analytics to GA4 #318

merged 1 commit into from
Jun 18, 2023

Conversation

BrunoRosendo
Copy link
Member

@BrunoRosendo BrunoRosendo commented May 20, 2023

closes #230

This PR ports the analytics system from GA3/UA to Google Analytics 4.

This should be currently enough to have it running but I still need to test all the functionalities we had previously. I also want to check which new functionalities we might want to use or change from GA3, since GA4 remade how data is handled.

Since GA4 is completely different from GA3, it doesn't seem to be possible to port data over so we'll have to start recording again from the day we release the new version.

I also created new GA4 properties in NIJobs analytics account but I still need to check for extra configurations

@BrunoRosendo BrunoRosendo marked this pull request as draft May 20, 2023 02:18
@BrunoRosendo BrunoRosendo force-pushed the feature/analytics-ga4 branch from 5131e9c to c6dd43c Compare May 20, 2023 02:37
@BrunoRosendo
Copy link
Member Author

Data is already flowing to the new property in GA4. It'll also continue flowing to GA3 until 1st of July.

GA4 has a complete new interface and data flow but Google makes the transition easier by automatically translating old mechanisms to the new ones. GA4 is IMO simpler than GA3, everything is based on events and event parameters.

This means we can still use the old API (e.g. dimensions and old event system) and they'll all be converted into events and event parameters. This also means our code isn't very clear when compared to the new dashboard. I think we can change that later since porting over is what's mostly important right now.

Additionally, since the dashboard is brand new, we should also setup reports and charts in the new properties, which can be done in the staging property after merging to dev. GA4 offers more flexibility and less OOTB reports, so we need to generate our own.

I will be pushing the final version (code barely changes) in a while and asking for review

@BrunoRosendo
Copy link
Member Author

I've yet to successfully generate charts using our previous custom dimensions but it should be possible, by the documentation

image

Nevertheless, I created #319 to use the new event system properly

@BrunoRosendo
Copy link
Member Author

I also created #320 for the archive

@BrunoRosendo BrunoRosendo force-pushed the feature/analytics-ga4 branch 2 times, most recently from 4964af6 to f416e71 Compare May 22, 2023 00:47
@BrunoRosendo BrunoRosendo force-pushed the feature/analytics-ga4 branch from f416e71 to b02eab4 Compare May 22, 2023 01:33
@BrunoRosendo
Copy link
Member Author

I found some problems with the events, I need to figure out how to properly set this up to be completely compatible with timings and other events https://www.thyngster.com/performance-timing-tracking-with-google-analytics-4

@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Patch coverage: 75.00% and no project coverage change.

Comparison is base (7f34686) 89.07% compared to head (b02eab4) 89.07%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #318   +/-   ##
========================================
  Coverage    89.07%   89.07%           
========================================
  Files          176      176           
  Lines         3395     3395           
  Branches       855      855           
========================================
  Hits          3024     3024           
  Misses         371      371           
Impacted Files Coverage Δ
src/utils/analytics/index.js 85.96% <72.72%> (ø)
src/utils/index.js 90.43% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@Naapperas Naapperas left a comment

Choose a reason for hiding this comment

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

LGTM.

Left just a simple question but it does not need to be fixed.

@BrunoRosendo BrunoRosendo marked this pull request as ready for review June 13, 2023 16:16
@BrunoRosendo
Copy link
Member Author

@Naapperas can you do something about codecov? There is nothing to test on those lines

@Naapperas Naapperas merged commit c9be64e into develop Jun 18, 2023
@Naapperas Naapperas deleted the feature/analytics-ga4 branch June 18, 2023 22:24
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.

Switch from Universal Analytics to Google Analytics 4
2 participants