-
Notifications
You must be signed in to change notification settings - Fork 508
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
feat: remove ReactGA
and migrate to GA4
for tracking
#2071
Conversation
Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the approach is great! One less dependency.
Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
ReactGA
and migrate to GA4
for tracking
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2071 +/- ##
==========================================
+ Coverage 96.56% 96.57% +0.01%
==========================================
Files 255 254 -1
Lines 7623 7626 +3
Branches 1985 1986 +1
==========================================
+ Hits 7361 7365 +4
+ Misses 262 261 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
import ReactGA from 'react-ga'; | ||
import { WindowWithGATracking } from './ga'; | ||
|
||
declare let window: WindowWithGATracking; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const logTrackingCalls = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this function inside ga.tsx (and tests)? I don't see it being used outside, so odd to expose as public, especially since the dataLayer contact is for GA only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact, if feels like it could be combined with the gtag() function instead of always calling it explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aight. The combining idea sounds nice. I'll check it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have combined the logging with the gtag
function itself in the latest implementation. This WindowWithGATracking
is now only defined and used in ga.tsx
packages/jaeger-ui/src/vite-env.d.ts
Outdated
// defined in utils/tracking/ga.ts | ||
dataLayer: never; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate why this change is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thoughts, the most ideal implementation would be for
dataLayer
to have the appropriate types withinga.ts
and have the typenever
outside it so that no other module tries to access or modify the same.
This had been my initial reasoning but I think it would be better to remove it considering the way you have advised to handle the types in the previous comment.
Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Which problem is this PR solving?
Fixes #1332
Description of the changes
ReactGA
library for analytics and instead load the script ourselves asynchronouslygtag
function with the appropriate parametersHow was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test