diff --git a/extensions/amp-ad-network-adsense-impl/0.1/amp-ad-network-adsense-impl.js b/extensions/amp-ad-network-adsense-impl/0.1/amp-ad-network-adsense-impl.js index fcc5519e2771..06ca4af0e88a 100644 --- a/extensions/amp-ad-network-adsense-impl/0.1/amp-ad-network-adsense-impl.js +++ b/extensions/amp-ad-network-adsense-impl/0.1/amp-ad-network-adsense-impl.js @@ -94,6 +94,9 @@ export function resetSharedState() { /** @type {string} */ const FORMAT_EXP = 'as-use-attr-for-format'; +/** @type {string} */ +const DELAY_NUMBER_EXP = 'adsense-ff-number-delay'; + /** @final */ export class AmpAdNetworkAdsenseImpl extends AmpA4A { @@ -232,7 +235,8 @@ export class AmpAdNetworkAdsenseImpl extends AmpA4A { /** @override */ delayAdRequestEnabled() { - return true; + return getExperimentBranch( + this.win, DELAY_NUMBER_EXP) == '21063207' ? 3 : true; } /** @override */ @@ -281,6 +285,10 @@ export class AmpAdNetworkAdsenseImpl extends AmpA4A { Number(this.element.getAttribute('height')) > 0, branches: ['21062003', '21062004'], }, + [DELAY_NUMBER_EXP]: { + isTrafficEligible: () => true, + branches: ['21063206', '21063207'], + }, }); const setExps = randomlySelectUnsetExperiments(this.win, experimentInfoMap); Object.keys(setExps).forEach(expName => diff --git a/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js b/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js index cf7519306b6a..6e4a63937e3c 100644 --- a/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js +++ b/extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js @@ -975,6 +975,12 @@ describes.realWin('amp-ad-network-adsense-impl', { describe('#delayAdRequestEnabled', () => { it('should return true', () => expect(impl.delayAdRequestEnabled()).to.be.true); + + it('should return 3 if in experiment', () => { + forceExperimentBranch(impl.win, 'adsense-ff-number-delay', '21063207'); + impl.divertExperiments(); + expect(impl.delayAdRequestEnabled()).to.equal(3); + }); }); describe('#preconnect', () => {