-
Notifications
You must be signed in to change notification settings - Fork 105
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
EPMRPP-80423 || add google event for profile #3353
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3353 +/- ##
========================================
Coverage 62.03% 62.03%
========================================
Files 74 74
Lines 798 798
Branches 121 121
========================================
Hits 495 495
Misses 276 276
Partials 27 27 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
const BASIC_EVENT_PARAMETERS_PROFILE = { | ||
action: 'click', | ||
category: PROFILE_PAGE, | ||
element_name: 'language_drop_down', |
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.
element_name can change very frequently. That is why I suppose to put that field in every event instead of putting it in BASIC_EVENT_PARAMETERS object. Or we can create a function, which takes element_name as a parameter and returns BASIC_EVENT_PARAMETERS object.
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.
fixed ✅
@@ -33,7 +33,7 @@ import { | |||
} from 'common/constants/supportedLanguages'; | |||
import { langSelector, setLangAction } from 'controllers/lang'; | |||
import { InputDropdown } from 'components/inputs/inputDropdown'; | |||
import { PROFILE_PAGE_EVENTS } from 'components/main/analytics/events'; | |||
import { PROFILE_EVENT } from 'components/main/analytics/events/ga4Events/profilePageEvent'; |
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.
We have an alias for that path. You can find it in basic webpack config
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.
fixed ✅
@@ -78,6 +78,16 @@ const messages = defineMessages({ | |||
}, | |||
}); | |||
|
|||
const langName = { |
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.
Maybe it is better to move that object to Profile page events?
And we already have these values in constants.
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.
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.
That is what I mean.
U can create object langName = { [ENGLISH]:'english' }
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.
you correct! fixed ✅
zh: 'chinese', | ||
}; | ||
|
||
const langNameByCode = (code) => langName[code]; |
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.
Do we really need that function?
We can easily langName[lang].
And maybe LangNameMap will be a better name?
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 this function in 1 line improves the readability of the code (langNameByCode(lang) more understandable than langName[lang]), and the name langNameByCode makes it clear what the function does, unlike LangNameMap
action: 'click', | ||
category: PROFILE_PAGE, | ||
element_name: 'language_drop_down', | ||
place: PROFILE_PAGE, |
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.
And also, discuss that property with WA. Because in the task description we do not have it.
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.
already WA added this property
EPMRPP-80423
change universal analytics to ga4