diff --git a/blocks/marketing/marketing.js b/blocks/marketing/marketing.js index ca5116f..1ecd2f2 100644 --- a/blocks/marketing/marketing.js +++ b/blocks/marketing/marketing.js @@ -81,22 +81,18 @@ export default async function decorate(block) { document.addEventListener('scroll', checkBottomAdDisplay); } } else { - window.tude.setFeatureFlags({ injectAds: false }); + window.tude.setFeatureFlags({injectAds: false}); const adTest = new URLSearchParams(window.location.search).get('ad_test'); - if (adTest) { - window.tude.refreshAdsViaDivMappings([{ - divId: slot, - baseDivId: slot, - targeting: { - ad_test: adTest, - }, - }]); - } else { - window.tude.refreshAdsViaDivMappings([{ - divId: slot, - baseDivId: slot, - }]); + const adMapping = { + divId: slot, + baseDivId: slot, } + if (adTest) adMapping.targeting = { + ad_test: adTest, + } + window.tude.refreshAdsViaDivMappings([ + adMapping + ]); } }); });