From 4ca9a4840b51f29d137291332b308b17bc0e0cb8 Mon Sep 17 00:00:00 2001 From: bosco-ensemble Date: Wed, 17 Apr 2024 09:49:25 -0700 Subject: [PATCH] TDW-2409 added ability to fetch ad_test value from url params --- blocks/marketing/marketing.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/blocks/marketing/marketing.js b/blocks/marketing/marketing.js index 1bb173e4..9484c18b 100644 --- a/blocks/marketing/marketing.js +++ b/blocks/marketing/marketing.js @@ -82,10 +82,21 @@ export default async function decorate(block) { } } else { window.tude.setFeatureFlags({ injectAds: false }); - window.tude.refreshAdsViaDivMappings([{ - divId: slot, - baseDivId: slot, - }]); + const ad_test = new URLSearchParams(window.location.search).get('ad_test'); + if(ad_test) { + window.tude.refreshAdsViaDivMappings([{ + divId: slot, + baseDivId: slot, + targeting: { + ad_test: ad_test + } + }]); + } else { + window.tude.refreshAdsViaDivMappings([{ + divId: slot, + baseDivId: slot, + }]); + } } }); });