Skip to content

Commit

Permalink
undo config updates per bidder for vendor checks
Browse files Browse the repository at this point in the history
As setupPrebid is only run once, the config is not updated when consent changes.
If a user decides to withdraw consent for a vendor, this should be updated in the config. This should be done in a separate piece of work.
  • Loading branch information
cemms1 committed Feb 25, 2025
1 parent 90d1308 commit 1df88d2
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/lib/header-bidding/prebid/prebid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ import type {
} from '../prebid-types';
import { getHeaderBiddingAdSlots } from '../slot-config';
import {
shouldIncludeCriteo,
shouldIncludeIndexExchange,
shouldIncludeKargo,
shouldIncludeMagnite,
shouldIncludeOzone,
isSwitchedOn,
shouldIncludePermutive,
shouldIncludeXaxis,
stripDfpAdPrefixFrom,
} from '../utils';
import { bids } from './bid-config';
Expand Down Expand Up @@ -427,7 +422,7 @@ const initialise = (window: Window, consentState: ConsentState): void => {
};
}

if (shouldIncludeCriteo(consentState)) {
if (isSwitchedOn('prebidCriteo')) {
window.pbjs.bidderSettings.criteo = {
storageAllowed: true,
};
Expand All @@ -442,7 +437,7 @@ const initialise = (window: Window, consentState: ConsentState): void => {
});
}

if (shouldIncludeOzone(consentState)) {
if (isSwitchedOn('prebidOzone')) {
// Use a custom price granularity, which is based upon the size of the slot being auctioned
window.pbjs.setBidderConfig({
bidders: ['ozone'],
Expand All @@ -464,7 +459,7 @@ const initialise = (window: Window, consentState: ConsentState): void => {
});
}

if (shouldIncludeIndexExchange(consentState)) {
if (isSwitchedOn('prebidIndexExchange')) {
window.pbjs.setBidderConfig({
bidders: ['ix'],
config: {
Expand Down Expand Up @@ -499,7 +494,7 @@ const initialise = (window: Window, consentState: ConsentState): void => {
]);
}

if (shouldIncludeXaxis(consentState)) {
if (isSwitchedOn('prebidXaxis')) {
window.pbjs.bidderSettings.xhb = {
adserverTargeting: [
{
Expand All @@ -516,13 +511,13 @@ const initialise = (window: Window, consentState: ConsentState): void => {
};
}

if (shouldIncludeKargo()) {
if (isSwitchedOn('prebidKargo')) {
window.pbjs.bidderSettings.kargo = {
storageAllowed: true,
};
}

if (shouldIncludeMagnite(consentState)) {
if (isSwitchedOn('prebidMagnite')) {
window.pbjs.bidderSettings.magnite = {
storageAllowed: true,
};
Expand Down

0 comments on commit 1df88d2

Please sign in to comment.