From f8be97a6f5e29bf911ec952dfbee85fc7ca10327 Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Mon, 15 Jul 2024 17:10:54 +0100 Subject: [PATCH 1/8] Add prebid magnite as a bidder --- src/experiments/ab-tests.ts | 2 + src/experiments/tests/prebid-magnite.ts | 28 +++++++ src/lib/header-bidding/prebid-types.ts | 9 +++ src/lib/header-bidding/prebid/bid-config.ts | 84 +++++++++++++++++++++ src/lib/header-bidding/prebid/prebid.ts | 7 ++ src/lib/header-bidding/utils.ts | 12 +++ 6 files changed, 142 insertions(+) create mode 100644 src/experiments/tests/prebid-magnite.ts diff --git a/src/experiments/ab-tests.ts b/src/experiments/ab-tests.ts index f0ba76467..0191dd926 100644 --- a/src/experiments/ab-tests.ts +++ b/src/experiments/ab-tests.ts @@ -1,5 +1,6 @@ import type { ABTest } from '@guardian/ab-core'; import { mpuWhenNoEpic } from './tests/mpu-when-no-epic'; +import { prebidMagnite } from './tests/prebid-magnite'; /** * You only need to add tests to this file if the code you are testing is here in @@ -9,4 +10,5 @@ import { mpuWhenNoEpic } from './tests/mpu-when-no-epic'; export const concurrentTests: readonly ABTest[] = [ // one test per line mpuWhenNoEpic, + prebidMagnite, ]; diff --git a/src/experiments/tests/prebid-magnite.ts b/src/experiments/tests/prebid-magnite.ts new file mode 100644 index 000000000..a6634d804 --- /dev/null +++ b/src/experiments/tests/prebid-magnite.ts @@ -0,0 +1,28 @@ +import type { ABTest } from '@guardian/ab-core'; + +export const prebidMagnite: ABTest = { + id: 'PrebidMagnite', + author: '@commercial-dev', + start: '2024-07-22', + expiry: '2024-09-20', + audience: 0 / 100, + audienceOffset: 0 / 100, + audienceCriteria: '', + successMeasure: '', + description: 'Test Prebid Magnite integration.', + variants: [ + { + id: 'control', + test: (): void => { + /* no-op */ + }, + }, + { + id: 'variant', + test: (): void => { + /* no-op */ + }, + }, + ], + canRun: () => true, +}; diff --git a/src/lib/header-bidding/prebid-types.ts b/src/lib/header-bidding/prebid-types.ts index fb36bb844..69a0ad4ab 100644 --- a/src/lib/header-bidding/prebid-types.ts +++ b/src/lib/header-bidding/prebid-types.ts @@ -119,6 +119,13 @@ export type PrebidKargoParams = { placementId: string; }; +//This is used to be called Rubicon but now it's called Magnite. You can find it in the Prebid.js codebase as Rubicon +export type PrebidMagniteParams = { + accountId: number; + siteId: number; + zoneId: number; +}; + export type BidderCode = | 'adyoulike' | 'and' @@ -127,6 +134,7 @@ export type BidderCode = | 'improvedigital' | 'ix' | 'kargo' + | 'magnite' | 'oxd' | 'ozone' | 'pubmatic' @@ -143,6 +151,7 @@ export type PrebidParams = | PrebidImproveParams | PrebidIndexExchangeParams | PrebidKargoParams + | PrebidMagniteParams | PrebidOpenXParams | PrebidOzoneParams | PrebidPubmaticParams diff --git a/src/lib/header-bidding/prebid/bid-config.ts b/src/lib/header-bidding/prebid/bid-config.ts index 13cfdb187..7ee4dd036 100644 --- a/src/lib/header-bidding/prebid/bid-config.ts +++ b/src/lib/header-bidding/prebid/bid-config.ts @@ -8,6 +8,7 @@ import { dfpEnv } from 'lib/dfp/dfp-env'; import type { PrebidIndexSite } from 'types/global'; import { isInAuOrNz, + isInAustralia, isInRow, isInUk, isInUsa, @@ -24,6 +25,7 @@ import type { PrebidImproveParams, PrebidIndexExchangeParams, PrebidKargoParams, + PrebidMagniteParams, PrebidOpenXParams, PrebidOzoneParams, PrebidPubmaticParams, @@ -41,6 +43,8 @@ import { containsMobileSticky, containsMpu, containsMpuOrDmpu, + containsPortraitInterstitial, + containsWS, getBreakpointKey, shouldIncludeAdYouLike, shouldIncludeAppNexus, @@ -48,6 +52,7 @@ import { shouldIncludeImproveDigital, shouldIncludeImproveDigitalSkin, shouldIncludeKargo, + shouldIncludeMagnite, shouldIncludeOpenx, shouldIncludeSmart, shouldIncludeSonobi, @@ -384,6 +389,71 @@ const getKargoPlacementId = (sizes: HeaderBiddingSize[]): string => { return '_y9LINEsbfh'; }; +const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { + if (isInUk()) { + switch (getBreakpointKey()) { + case 'D': + if (containsMpuOrDmpu(sizes) || containsWS(sizes)) { + return 3426780; + } + // top-above-nav on desktop + if (containsLeaderboardOrBillboard(sizes)) { + return 3426786; + } + // Fronts-banners on desktop + if (containsBillboard(sizes)) { + return 3426790; + } + break; + case 'M': + if (containsMpu(sizes) || containsPortraitInterstitial(sizes)) { + return 3426778; + } + break; + } + } + return -1; +}; + +const getMagniteSiteId = (): number => { + if (isInUk()) { + switch (getBreakpointKey()) { + case 'D': + return 549358; + case 'M': + return 549374; + } + } + + if (isInRow()) { + switch (getBreakpointKey()) { + case 'D': + return 549496; + case 'M': + return 549498; + } + } + + if (isInUsa()) { + switch (getBreakpointKey()) { + case 'D': + return 554244; + case 'M': + return 554248; + } + } + + if (isInAustralia()) { + switch (getBreakpointKey()) { + case 'D': + return 554256; + case 'M': + return 554258; + } + } + return -1; +}; + const pubmaticBidder = (slotSizes: HeaderBiddingSize[]): PrebidBidder => { const defaultParams = { name: 'pubmatic' as BidderCode, @@ -533,6 +603,19 @@ const kargoBidder: PrebidBidder = { }), }; +const magniteBidder: PrebidBidder = { + name: 'magnite', + switchName: 'prebidMagnite', + bidParams: ( + _slotId: string, + sizes: HeaderBiddingSize[], + ): PrebidMagniteParams => ({ + accountId: 26644, + siteId: getMagniteSiteId(), + zoneId: getMagniteZoneId(sizes), + }), +}; + // There's an IX bidder for every size that the slot can take const indexExchangeBidders = ( slotSizes: HeaderBiddingSize[], @@ -577,6 +660,7 @@ const currentBidders = ( [shouldUseOzoneAdaptor(), ozoneClientSideBidder(pageTargeting)], [shouldIncludeOpenx(), openxClientSideBidder(pageTargeting)], [shouldIncludeKargo(), kargoBidder], + [shouldIncludeMagnite(), magniteBidder], ]; const otherBidders = biddersToCheck diff --git a/src/lib/header-bidding/prebid/prebid.ts b/src/lib/header-bidding/prebid/prebid.ts index b7952d804..8a8b1eff4 100644 --- a/src/lib/header-bidding/prebid/prebid.ts +++ b/src/lib/header-bidding/prebid/prebid.ts @@ -142,6 +142,7 @@ type BidderSettings = { ozone?: Partial; criteo?: Partial; kargo?: Partial; + magnite?: Partial; }; class PrebidAdUnit { @@ -443,6 +444,12 @@ const initialise = ( }; } + if (window.guardian.config.switches.prebidMagnite) { + window.pbjs.bidderSettings.magnite = { + storageAllowed: true, + }; + } + window.pbjs.setConfig(pbjsConfig); // Adjust slot size when prebid ad loads diff --git a/src/lib/header-bidding/utils.ts b/src/lib/header-bidding/utils.ts index 66e464331..75be07cd6 100644 --- a/src/lib/header-bidding/utils.ts +++ b/src/lib/header-bidding/utils.ts @@ -1,12 +1,15 @@ import { isString } from '@guardian/libs'; import { once } from 'lodash-es'; import { createAdSize } from 'core/ad-sizes'; +import { isInVariantSynchronous } from 'experiments/ab'; +import { prebidMagnite } from 'experiments/tests/prebid-magnite'; import { getCurrentTweakpoint, matchesBreakpoints, } from 'lib/detect/detect-breakpoint'; import { isInAuOrNz, + isInAustralia, isInCanada, isInRow, isInUk, @@ -104,6 +107,10 @@ export const containsLeaderboardOrBillboard = ( sizes: HeaderBiddingSize[], ): boolean => containsLeaderboard(sizes) || containsBillboard(sizes); +export const containsPortraitInterstitial = ( + sizes: HeaderBiddingSize[], +): boolean => contains(sizes, createAdSize(320, 480)); + export const getLargestSize = ( sizes: HeaderBiddingSize[], ): HeaderBiddingSize | null => { @@ -194,6 +201,11 @@ export const shouldIncludeSmart = (): boolean => isInUk() || isInRow(); export const shouldIncludeKargo = (): boolean => isInUsa(); +//Add the switch here and the AB test checks +export const shouldIncludeMagnite = (): boolean => + (isInUk() || isInRow() || isInUsa() || isInAustralia()) && + isInVariantSynchronous(prebidMagnite, 'variant'); + export const shouldIncludeMobileSticky = once( (): boolean => window.location.hash.includes('#mobile-sticky') || From aa7041cd13b87d1bdf5710c35c1832582c24bf63 Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Tue, 16 Jul 2024 10:32:13 +0100 Subject: [PATCH 2/8] Add the zoneIds for ROW, US and AUS --- src/lib/header-bidding/prebid/bid-config.ts | 86 +++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/src/lib/header-bidding/prebid/bid-config.ts b/src/lib/header-bidding/prebid/bid-config.ts index 7ee4dd036..0e5460a63 100644 --- a/src/lib/header-bidding/prebid/bid-config.ts +++ b/src/lib/header-bidding/prebid/bid-config.ts @@ -410,6 +410,92 @@ const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { return 3426778; } break; + default: + return -1; + } + } + + if (isInRow()) { + switch (getBreakpointKey()) { + case 'D': + if (containsMpuOrDmpu(sizes) || containsWS(sizes)) { + return 3426822; + } + // top-above-nav on desktop + if (containsLeaderboardOrBillboard(sizes)) { + return 3426828; + } + // Fronts-banners on desktop + if (containsBillboard(sizes)) { + return 3426834; + } + break; + case 'M': + if (containsMpu(sizes) || containsPortraitInterstitial(sizes)) { + return 3426836; + } + if (containsMobileSticky(sizes)) { + return 3477560; + } + break; + default: + return -1; + } + } + + if (isInUsa()) { + switch (getBreakpointKey()) { + case 'D': + if (containsMpuOrDmpu(sizes) || containsWS(sizes)) { + return 3471422; + } + // top-above-nav on desktop + if (containsLeaderboardOrBillboard(sizes)) { + return 3471428; + } + // Fronts-banners on desktop + if (containsBillboard(sizes)) { + return 3471434; + } + break; + case 'M': + if (containsMpu(sizes) || containsPortraitInterstitial(sizes)) { + return 3471436; + } + if (containsMobileSticky(sizes)) { + return 3471440; + } + break; + default: + return -1; + } + } + + if (isInAustralia()) { + switch (getBreakpointKey()) { + case 'D': + if (containsMpuOrDmpu(sizes) || containsWS(sizes)) { + return 3471452; + } + // top-above-nav on desktop + if (containsLeaderboardOrBillboard(sizes)) { + return 3471458; + } + // Fronts-banners on desktop + if (containsBillboard(sizes)) { + return 3471462; + } + break; + case 'M': + if (containsMpu(sizes) || containsPortraitInterstitial(sizes)) { + return 3471464; + } + if (containsMobileSticky(sizes)) { + return 3471468; + } + break; + default: + return -1; } } return -1; From 2abcd53a58270a76fa119ade24416a177d17fe7f Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Tue, 16 Jul 2024 12:52:36 +0100 Subject: [PATCH 3/8] Add a slotId parameter to getMagniteZoneId for extra checks --- src/lib/header-bidding/prebid/bid-config.ts | 47 ++++++++++++++++----- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/lib/header-bidding/prebid/bid-config.ts b/src/lib/header-bidding/prebid/bid-config.ts index 0e5460a63..bc9d5ff4c 100644 --- a/src/lib/header-bidding/prebid/bid-config.ts +++ b/src/lib/header-bidding/prebid/bid-config.ts @@ -389,7 +389,10 @@ const getKargoPlacementId = (sizes: HeaderBiddingSize[]): string => { return '_y9LINEsbfh'; }; -const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { +const getMagniteZoneId = ( + slotId: string, + sizes: HeaderBiddingSize[], +): number => { if (isInUk()) { switch (getBreakpointKey()) { case 'D': @@ -397,11 +400,17 @@ const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { return 3426780; } // top-above-nav on desktop - if (containsLeaderboardOrBillboard(sizes)) { + if ( + containsLeaderboardOrBillboard(sizes) && + slotId === 'dfp-ad--top-above-nav' + ) { return 3426786; } // Fronts-banners on desktop - if (containsBillboard(sizes)) { + if ( + containsBillboard(sizes) && + slotId.includes('fronts-banner') + ) { return 3426790; } break; @@ -422,11 +431,17 @@ const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { return 3426822; } // top-above-nav on desktop - if (containsLeaderboardOrBillboard(sizes)) { + if ( + containsLeaderboardOrBillboard(sizes) && + slotId === 'dfp-ad--top-above-nav' + ) { return 3426828; } // Fronts-banners on desktop - if (containsBillboard(sizes)) { + if ( + containsBillboard(sizes) && + slotId.includes('fronts-banner') + ) { return 3426834; } break; @@ -450,11 +465,17 @@ const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { return 3471422; } // top-above-nav on desktop - if (containsLeaderboardOrBillboard(sizes)) { + if ( + containsLeaderboardOrBillboard(sizes) && + slotId === 'dfp-ad--top-above-nav' + ) { return 3471428; } // Fronts-banners on desktop - if (containsBillboard(sizes)) { + if ( + containsBillboard(sizes) && + slotId.includes('fronts-banner') + ) { return 3471434; } break; @@ -478,11 +499,17 @@ const getMagniteZoneId = (sizes: HeaderBiddingSize[]): number => { return 3471452; } // top-above-nav on desktop - if (containsLeaderboardOrBillboard(sizes)) { + if ( + containsLeaderboardOrBillboard(sizes) && + slotId === 'dfp-ad--top-above-nav' + ) { return 3471458; } // Fronts-banners on desktop - if (containsBillboard(sizes)) { + if ( + containsBillboard(sizes) && + slotId.includes('fronts-banner') + ) { return 3471462; } break; @@ -698,7 +725,7 @@ const magniteBidder: PrebidBidder = { ): PrebidMagniteParams => ({ accountId: 26644, siteId: getMagniteSiteId(), - zoneId: getMagniteZoneId(sizes), + zoneId: getMagniteZoneId(_slotId, sizes), }), }; From 2f2f33e2b99503b9f3c2b275b6496c9247e99e9f Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Thu, 18 Jul 2024 10:06:45 +0100 Subject: [PATCH 4/8] Upgrade guardian/prebid.js to include magnite aka rubicon adapter --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 90bfe3e45..c03455f7c 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "dependencies": { "@changesets/cli": "^2.26.2", "@guardian/ophan-tracker-js": "2.1.1", - "@guardian/prebid.js": "8.52.0", + "@guardian/prebid.js": "8.52.0-1", "@octokit/core": "^6.1.2", "fastdom": "^1.0.11", "lodash-es": "^4.17.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38e2b02fa..80cb2adf5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: 2.1.1 version: 2.1.1 '@guardian/prebid.js': - specifier: 8.52.0 - version: 8.52.0(babel-core@7.0.0-bridge.0)(tslib@2.6.3)(typescript@5.3.3) + specifier: 8.52.0-1 + version: 8.52.0-1(babel-core@7.0.0-bridge.0)(tslib@2.6.3)(typescript@5.3.3) '@octokit/core': specifier: ^6.1.2 version: 6.1.2 @@ -2070,8 +2070,8 @@ packages: engines: {node: '>=16'} dev: false - /@guardian/prebid.js@8.52.0(babel-core@7.0.0-bridge.0)(tslib@2.6.3)(typescript@5.3.3): - resolution: {integrity: sha512-ttN87kbWNDeIfyBBd9zEoFDK4ofY3fa3Tqgi0vSa6L+EiQBvZ6WfXk3dvHBsFssXYM3Zz6jNcbq3XnGY1C5iRA==} + /@guardian/prebid.js@8.52.0-1(babel-core@7.0.0-bridge.0)(tslib@2.6.3)(typescript@5.3.3): + resolution: {integrity: sha512-nXEKVwJ0dGpKFZp31tiAHQ4gQAgLq6Ob/e3X6cxx1P87FeFBg7zFj3pgk6VfxySz6R6SXIL5BOts/SSTkVwlUQ==} engines: {node: '>=12.0.0'} dependencies: '@babel/core': 7.24.7 From 4960b595cb3a2b0c7b2ef65694c5de625d0dc2ab Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Thu, 18 Jul 2024 12:44:09 +0100 Subject: [PATCH 5/8] Change AB test date/message and add correct regions --- src/experiments/tests/prebid-magnite.ts | 4 ++-- src/lib/header-bidding/prebid/bid-config.ts | 9 ++++----- src/lib/header-bidding/utils.ts | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/experiments/tests/prebid-magnite.ts b/src/experiments/tests/prebid-magnite.ts index a6634d804..bc4781ef1 100644 --- a/src/experiments/tests/prebid-magnite.ts +++ b/src/experiments/tests/prebid-magnite.ts @@ -4,12 +4,12 @@ export const prebidMagnite: ABTest = { id: 'PrebidMagnite', author: '@commercial-dev', start: '2024-07-22', - expiry: '2024-09-20', + expiry: '2024-09-30', audience: 0 / 100, audienceOffset: 0 / 100, audienceCriteria: '', successMeasure: '', - description: 'Test Prebid Magnite integration.', + description: 'Test Magnite as a prebid bdidder.', variants: [ { id: 'control', diff --git a/src/lib/header-bidding/prebid/bid-config.ts b/src/lib/header-bidding/prebid/bid-config.ts index bc9d5ff4c..d281dfcea 100644 --- a/src/lib/header-bidding/prebid/bid-config.ts +++ b/src/lib/header-bidding/prebid/bid-config.ts @@ -8,7 +8,6 @@ import { dfpEnv } from 'lib/dfp/dfp-env'; import type { PrebidIndexSite } from 'types/global'; import { isInAuOrNz, - isInAustralia, isInRow, isInUk, isInUsa, @@ -458,7 +457,7 @@ const getMagniteZoneId = ( } } - if (isInUsa()) { + if (isInUsOrCa()) { switch (getBreakpointKey()) { case 'D': if (containsMpuOrDmpu(sizes) || containsWS(sizes)) { @@ -492,7 +491,7 @@ const getMagniteZoneId = ( } } - if (isInAustralia()) { + if (isInAuOrNz()) { switch (getBreakpointKey()) { case 'D': if (containsMpuOrDmpu(sizes) || containsWS(sizes)) { @@ -547,7 +546,7 @@ const getMagniteSiteId = (): number => { } } - if (isInUsa()) { + if (isInUsOrCa()) { switch (getBreakpointKey()) { case 'D': return 554244; @@ -556,7 +555,7 @@ const getMagniteSiteId = (): number => { } } - if (isInAustralia()) { + if (isInAuOrNz()) { switch (getBreakpointKey()) { case 'D': return 554256; diff --git a/src/lib/header-bidding/utils.ts b/src/lib/header-bidding/utils.ts index 75be07cd6..9365d90fa 100644 --- a/src/lib/header-bidding/utils.ts +++ b/src/lib/header-bidding/utils.ts @@ -9,7 +9,6 @@ import { } from 'lib/detect/detect-breakpoint'; import { isInAuOrNz, - isInAustralia, isInCanada, isInRow, isInUk, @@ -203,7 +202,7 @@ export const shouldIncludeKargo = (): boolean => isInUsa(); //Add the switch here and the AB test checks export const shouldIncludeMagnite = (): boolean => - (isInUk() || isInRow() || isInUsa() || isInAustralia()) && + (isInUk() || isInRow() || isInUsOrCa() || isInAuOrNz()) && isInVariantSynchronous(prebidMagnite, 'variant'); export const shouldIncludeMobileSticky = once( From e441dc0df32038a47ee317dc51b253504abff9c3 Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Thu, 18 Jul 2024 14:41:37 +0100 Subject: [PATCH 6/8] Update typo and start date --- src/experiments/tests/prebid-magnite.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/experiments/tests/prebid-magnite.ts b/src/experiments/tests/prebid-magnite.ts index bc4781ef1..40cb11c9d 100644 --- a/src/experiments/tests/prebid-magnite.ts +++ b/src/experiments/tests/prebid-magnite.ts @@ -3,13 +3,13 @@ import type { ABTest } from '@guardian/ab-core'; export const prebidMagnite: ABTest = { id: 'PrebidMagnite', author: '@commercial-dev', - start: '2024-07-22', + start: '2024-07-18', expiry: '2024-09-30', audience: 0 / 100, audienceOffset: 0 / 100, audienceCriteria: '', successMeasure: '', - description: 'Test Magnite as a prebid bdidder.', + description: 'Test Magnite as a prebid bidder.', variants: [ { id: 'control', From d0eabb488b046d8791e7a3937ed88130bd9b3b41 Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Thu, 18 Jul 2024 17:08:44 +0100 Subject: [PATCH 7/8] Add the switch in shouldIncludeMagnite --- src/lib/header-bidding/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/header-bidding/utils.ts b/src/lib/header-bidding/utils.ts index 9365d90fa..69a8c14ad 100644 --- a/src/lib/header-bidding/utils.ts +++ b/src/lib/header-bidding/utils.ts @@ -203,6 +203,7 @@ export const shouldIncludeKargo = (): boolean => isInUsa(); //Add the switch here and the AB test checks export const shouldIncludeMagnite = (): boolean => (isInUk() || isInRow() || isInUsOrCa() || isInAuOrNz()) && + !!window.guardian.config.switches.prebidMagnite && isInVariantSynchronous(prebidMagnite, 'variant'); export const shouldIncludeMobileSticky = once( From fa5856f35ac48062b253936cb84a143713589080 Mon Sep 17 00:00:00 2001 From: Dina Hafez Date: Mon, 22 Jul 2024 10:10:47 +0100 Subject: [PATCH 8/8] Replace the old AB test with the refactored one --- src/lib/header-bidding/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/header-bidding/utils.ts b/src/lib/header-bidding/utils.ts index 69a8c14ad..1d8af566a 100644 --- a/src/lib/header-bidding/utils.ts +++ b/src/lib/header-bidding/utils.ts @@ -1,7 +1,7 @@ import { isString } from '@guardian/libs'; import { once } from 'lodash-es'; import { createAdSize } from 'core/ad-sizes'; -import { isInVariantSynchronous } from 'experiments/ab'; +import { isUserInVariant } from 'experiments/ab'; import { prebidMagnite } from 'experiments/tests/prebid-magnite'; import { getCurrentTweakpoint, @@ -204,7 +204,7 @@ export const shouldIncludeKargo = (): boolean => isInUsa(); export const shouldIncludeMagnite = (): boolean => (isInUk() || isInRow() || isInUsOrCa() || isInAuOrNz()) && !!window.guardian.config.switches.prebidMagnite && - isInVariantSynchronous(prebidMagnite, 'variant'); + isUserInVariant(prebidMagnite, 'variant'); export const shouldIncludeMobileSticky = once( (): boolean =>