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

Create advert density by section AB test #1296

Merged
merged 16 commits into from
Mar 19, 2024
Merged

Conversation

domlander
Copy link
Contributor

@domlander domlander commented Mar 6, 2024

What does this change?

Fix a bug with spacefinder not use the expected minAboveSlot when avoiding other winners on mobile, it adds 250px (the height of an MPU).

This was because spacefinder was using the same approach for floated right ads and inline ads. The additions to the docs explains why different approaches are needed for each type of ad.

So as not to change the ad density everywhere, I've fixed the bug, and changed the margin to 750px for mobile and retained 500px for desktop.

This PR also adds an AB test that will increase ad-density on articles in specific sections of the Guardian, e.g. business, money. For these test "high value sections" we will reduce it to 500px on mobile.

And finally fixes a bug with spacefinder avoiding elements inserted by the spacefinder debugger

Why?

  • This AB test will be used to investigate the impact of increasing ad-ratio in specific sections

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: 6f4c2a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/commercial Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@domlander domlander force-pushed the doml/section-ad-density-test branch from f63decf to bf6f92f Compare March 7, 2024 11:23
@@ -201,7 +201,6 @@ const countLiveblogInlineSlots = async (page: Page, isMobile: boolean) => {
return await page.locator(locator).count();
};

// @ts-expect-error -- used when logging uncommented
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get a warning on every PR with this unused function. Can we leave the console.warn in? It's only used for Playwright.

src/experiments/utils.ts Outdated Show resolved Hide resolved
@@ -147,9 +151,10 @@ const addDesktopInline1 = (): Promise<boolean> => {
minAbove: isImmersive ? 700 : 300,
minBelow: 300,
opponentSelectorRules: {
// don't place ads right after a heading
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed a little contradictory before: We allow an ad >5px below a heading but we must keep >190px above a heading? We shouldn't put ads closely below heading as this is likely to break up semantically related content. I think this was perhaps a mistake given the confusing naming of minAboveSlot .

@@ -288,14 +292,16 @@ const addDesktopInline2PlusAds = (): Promise<boolean> => {
};

const addMobileInlineAds = (): Promise<boolean> => {
const minDistanceFromArticleTop = isInAdDensityVariant ? 100 : 200;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From testing on my real device (N=1), this ad is still below the fold by a fair way, so I think this should be OK.

// selector(s) for the elements that we want to allow inserting ads above
/**
* Selector(s) for the elements that we want to allow inserting ads above
*/
candidateSelector: string | string[];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that the VS Code feature of hovering over a property to see its description works.

@Jakeii Jakeii added the [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR label Mar 12, 2024
Copy link
Contributor

🚀 0.0.0-beta-20240312170232 published to npm as a beta release

@Jakeii Jakeii marked this pull request as ready for review March 13, 2024 09:54
@Jakeii Jakeii requested a review from a team as a code owner March 13, 2024 09:54
@Jakeii Jakeii merged commit 6d621db into main Mar 19, 2024
10 checks passed
@Jakeii Jakeii deleted the doml/section-ad-density-test branch March 19, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants