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-156388 [MILO][MEP] fix for martech=off when page has manifest with enablements #2720

Merged
merged 5 commits into from
Aug 12, 2024
Merged
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
13 changes: 10 additions & 3 deletions libs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ export function getMetadata(name, doc = document) {
}

const handleEntitlements = (() => {
const { martech } = Object.fromEntries(PAGE_URL.searchParams);
if (martech === 'off') return () => {};
let entResolve;
const entPromise = new Promise((resolve) => {
entResolve = resolve;
Expand Down Expand Up @@ -924,16 +926,21 @@ export const getMepEnablement = (mdKey, paramKey = false) => {
};

async function checkForPageMods() {
const { mep: mepParam, mepHighlight, mepButton } = Object.fromEntries(PAGE_URL.searchParams);
const {
mep: mepParam,
mepHighlight,
mepButton,
martech,
} = Object.fromEntries(PAGE_URL.searchParams);
if (mepParam === 'off') return;
const pzn = getMepEnablement('personalization');
const promo = getMepEnablement('manifestnames', PROMO_PARAM);
const target = getMepEnablement('target');
const target = martech === 'off' ? false : getMepEnablement('target');
if (!(pzn || target || promo || mepParam
|| mepHighlight || mepButton || mepParam === '')) return;
if (target) {
loadMartech();
} else if (pzn) {
} else if (pzn && martech !== 'off') {
loadIms()
.then(() => {
/* c8 ignore next */
Expand Down
Loading