Skip to content

Commit

Permalink
Merge pull request #124 from hlxsites/TDW-2409-ad-value
Browse files Browse the repository at this point in the history
TDW-2409 added ability to fetch ad_test value from url params
  • Loading branch information
bosco-ensemble committed Apr 19, 2024
2 parents 23d6d8b + 5fc797f commit a6bf9c2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions blocks/marketing/marketing.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,19 @@ export default async function decorate(block) {
}
} else {
window.tude.setFeatureFlags({ injectAds: false });
window.tude.refreshAdsViaDivMappings([{
const adTest = new URLSearchParams(window.location.search).get('ad_test');
const adMapping = {
divId: slot,
baseDivId: slot,
}]);
};
if (adTest) {
adMapping.targeting = {
ad_test: adTest,
};
}
window.tude.refreshAdsViaDivMappings([
adMapping,
]);
}
});
});
Expand Down

0 comments on commit a6bf9c2

Please sign in to comment.