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

EPMRPP-80423 || add google event for profile #3353

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

KrasovskyAlexander
Copy link

EPMRPP-80423
change universal analytics to ga4
Screenshot_152

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2022

Codecov Report

Merging #3353 (d81b10d) into develop (1b573ee) will not change coverage.
The diff coverage is n/a.

@@           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',
Copy link
Contributor

@Bam6ycha Bam6ycha Dec 6, 2022

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.

Copy link
Author

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';
Copy link
Contributor

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

Copy link
Author

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 = {
Copy link
Contributor

@Bam6ycha Bam6ycha Dec 6, 2022

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.

Copy link
Author

@KrasovskyAlexander KrasovskyAlexander Dec 13, 2022

Choose a reason for hiding this comment

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

I think it's more logical to leave the object with languages in the localizationBlock.jsx file than in ProfilePageEvents(analytic file).
And I didn't find the constants, could you show me where they are?
Screenshot_155

We have constants with codes, but not with language names (names in English)

Copy link
Contributor

@Bam6ycha Bam6ycha Dec 13, 2022

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' }

Copy link
Author

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];
Copy link
Contributor

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?

Copy link
Author

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,
Copy link
Contributor

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.

Copy link
Author

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

@Vadim73i Vadim73i merged commit e81128b into develop Dec 13, 2022
@Vadim73i Vadim73i deleted the EPMRPP-80423_add-google-event-for-profile branch December 13, 2022 09:49
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.

None yet

4 participants