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

MWPW-149470[MILO][MEP] Remove sendTargetResponseAnalytics function #2371

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions libs/martech/martech.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,6 @@ function calculateResponseTime(responseStart) {
return roundToQuarter(responseTime);
}

function sendTargetResponseAnalytics(failure, responseStart, timeout, message) {
// temporary solution until we can decide on a better timeout value
const responseTime = calculateResponseTime(responseStart);
const timeoutTime = roundToQuarter(timeout);
let val = `target response time ${responseTime}:timed out ${failure}:timeout ${timeoutTime}`;
if (message) val += `:${message}`;
window.alloy('sendEvent', {
documentUnloading: true,
xdm: {
eventType: 'web.webinteraction.linkClicks',
web: {
webInteraction: {
linkClicks: { value: 1 },
type: 'other',
name: val,
},
},
},
data: { _adobe_corpnew: { digitalData: { primaryEvent: { eventInfo: { eventName: val } } } } },
});
}

const getTargetPersonalization = async () => {
const params = new URL(window.location.href).searchParams;

Expand All @@ -125,13 +103,7 @@ const getTargetPersonalization = async () => {

let manifests = [];
const response = await waitForEventOrTimeout(ALLOY_SEND_EVENT, timeout);
if (response.timeout) {
waitForEventOrTimeout(ALLOY_SEND_EVENT, 5100 - timeout)
.then(() => sendTargetResponseAnalytics(true, responseStart, timeout));
} else {
sendTargetResponseAnalytics(false, responseStart, timeout);
manifests = handleAlloyResponse(response.result);
}
manifests = handleAlloyResponse(response.result);

return manifests;
};
Expand Down
Loading