Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlaunch auto-ads-no-insertion-above holdback experiment #34425

Merged
merged 1 commit into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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