-
Notifications
You must be signed in to change notification settings - Fork 177
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
MWPW-149470 [MILO][MEP] Remove sendTargetResponseAnalytics function #3599
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #3599 +/- ##
==========================================
- Coverage 96.53% 96.52% -0.01%
==========================================
Files 274 274
Lines 61849 61815 -34
==========================================
- Hits 59705 59670 -35
- Misses 2144 2145 +1 ☔ View full report in Codecov by Sentry. |
This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR. |
) { | ||
let targetManifests = []; | ||
let targetPropositions = []; | ||
if (config?.mep?.enablePersV2 && targetInteractionPromise) { | ||
const { targetInteractionData, respTime, respStartTime } = await targetInteractionPromise; | ||
sendTargetResponseAnalytics(false, respStartTime, calculatedTimeout); | ||
const { targetInteractionData, respTime } = await targetInteractionPromise; |
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 remove the respStartTime
from the return value of targetInteractionPromise in utils?
Since it is used at only this 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.
Sorry, maybe I'm misunderstanding the comment. I am using it on line 1197. So 5 lines later
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.
@vgoodric, the targetInteractionPromise function is defined in utils.js and returns the respStartTime. Since this method is only invoked here and the respStartTime is no longer needed, we can remove it from the return value in utils.js as well.
So the code in utils.js changes from:
targetInteractionPromise = (async () => {
const { loadAnalyticsAndInteractionData } = await import('../martech/helpers.js');
const now = performance.now();
performance.mark('interaction-start');
const data = await loadAnalyticsAndInteractionData(
{ locale, env: getEnv({})?.name, calculatedTimeout, hybridPersEnabled },
);
performance.mark('interaction-end');
performance.measure('total-time', 'interaction-start', 'interaction-end');
const respTime = performance.getEntriesByName('total-time')[0];
return { targetInteractionData: data, respTime, respStartTime: now };
})();
to
targetInteractionPromise = (async () => {
const { loadAnalyticsAndInteractionData } = await import('../martech/helpers.js');
performance.mark('interaction-start');
const data = await loadAnalyticsAndInteractionData(
{ locale, env: getEnv({})?.name, calculatedTimeout, hybridPersEnabled },
);
performance.mark('interaction-end');
performance.measure('total-time', 'interaction-start', 'interaction-end');
const respTime = performance.getEntriesByName('total-time')[0];
return { targetInteractionData: data, respTime };
})();
On hold so we can use this to measure pznv2 |
Resolves: MWPW-149470
Test URLs: