Skip to content

Commit

Permalink
Unlaunch auto-ads-no-insertion-above holdback experiment (#34425)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerivq authored May 24, 2021
1 parent 356de34 commit 13f91a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
3 changes: 1 addition & 2 deletions build-system/global-configs/prod-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
"amp-consent-granular-consent": 1,
"amp-cid-backup": 1,
"3p-vendor-split": 0.1,
"story-ad-placements": 0.01,
"auto-ads-no-insertion-above": 0.2
"story-ad-placements": 0.01
}
37 changes: 1 addition & 36 deletions extensions/amp-auto-ads/0.1/placement.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
cloneLayoutMarginsChangeDef,
} from '../../../src/layout-rect';
import {Services} from '../../../src/services';
import {addExperimentIdToElement} from '../../../ads/google/a4a/traffic-experiments';
import {
closestAncestorElementBySelector,
createElementWithAttributes,
Expand All @@ -29,11 +28,6 @@ import {
} from '../../../src/dom';
import {dev, user} from '../../../src/log';
import {dict} from '../../../src/core/types/object';
import {
getExperimentBranch,
isExperimentOn,
randomlySelectUnsetExperiments,
} from '../../../src/experiments';
import {measurePageLayoutBox} from '../../../src/utils/page-layout-box';

/** @const */
Expand Down Expand Up @@ -200,30 +194,7 @@ export class Placement {
*/
placeAd(baseAttributes, sizing, adTracker, isResponsiveEnabled) {
return this.getEstimatedPosition().then((yPosition) => {
// TODO(powerivq@) Remove this after finishing the experiment
const controlBranch = '31060868';
const expBranch = '31060869';
const holdbackExp = isExperimentOn(
this.ampdoc.win,
'auto-ads-no-insertion-above'
);
if (holdbackExp) {
const expInfoList =
/** @type {!Array<!../../../experiments.ExperimentInfo>} */ ([
{
experimentId: 'auto-ads-no-insertion-above',
isTrafficEligible: () => true,
branches: [controlBranch, expBranch],
},
]);
randomlySelectUnsetExperiments(this.ampdoc.win, expInfoList);
}
if (
(!holdbackExp ||
getExperimentBranch(this.ampdoc.win, 'auto-ads-no-insertion-above') ==
expBranch) &&
this.ampdoc.win./*OK*/ scrollY > yPosition
) {
if (this.ampdoc.win./*OK*/ scrollY > yPosition) {
this.state_ = PlacementState.UNUSED;
return this.state_;
}
Expand All @@ -239,12 +210,6 @@ export class Placement {
this.adElement_ = shouldUseFullWidthResponsive
? this.createFullWidthResponsiveAdElement_(baseAttributes)
: this.createAdElement_(baseAttributes, sizing.width);
if (holdbackExp) {
addExperimentIdToElement(
getExperimentBranch(this.ampdoc.win, 'auto-ads-no-insertion-above'),
this.getAdElement()
);
}

this.injector_(this.anchorElement_, this.getAdElement());

Expand Down

0 comments on commit 13f91a8

Please sign in to comment.