@@ -28,7 +28,6 @@ import {
2828 isSwitchedOn ,
2929 shouldIncludeBidder ,
3030 shouldIncludePermutive ,
31- shouldIncludePrebidAdUnit ,
3231 stripDfpAdPrefixFrom ,
3332} from '../utils' ;
3433import { bids } from './bid-config' ;
@@ -119,7 +118,6 @@ type PbjsConfig = {
119118 } ;
120119 consentManagement ?: ConsentManagement ;
121120 realTimeData ?: unknown ;
122- useBidCache ?: boolean ;
123121 customPriceBucket ?: PrebidPriceGranularity ;
124122 /**
125123 * This is a custom property that has been added to our fork of prebid.js
@@ -222,7 +220,7 @@ class PrebidAdUnit {
222220 pageTargeting : PageTargeting ,
223221 consentState : ConsentState ,
224222 ) {
225- this . code = shouldIncludePrebidAdUnit ? advert . prebidAdUnit : advert . id ;
223+ this . code = advert . id ;
226224 this . mediaTypes = { banner : { sizes : slot . sizes } } ;
227225 this . gpid = this . generateGpid ( advert , slot ) ;
228226 this . ortb2Imp = {
@@ -235,15 +233,15 @@ class PrebidAdUnit {
235233 } ;
236234
237235 this . bids = bids (
238- shouldIncludePrebidAdUnit ? advert . prebidAdUnit : advert . id ,
236+ advert . id ,
239237 slot . sizes ,
240238 pageTargeting ,
241239 this . gpid ,
242240 consentState ,
243241 ) ;
244242
245243 advert . headerBiddingSizes = slot . sizes ;
246- log ( 'commercial' , `PrebidAdUnit ${ advert . id } ` , this . bids ) ;
244+ log ( 'commercial' , `PrebidAdUnit ${ this . code } ` , this . bids ) ;
247245 }
248246
249247 isEmpty ( ) {
@@ -296,9 +294,7 @@ declare global {
296294 onEvent : ( event : PbjsEvent , handler : PbjsEventHandler ) => void ;
297295 setTargetingForGPTAsync : (
298296 codeArr ?: string [ ] ,
299- customSlotMatching ?: (
300- slot : googletag . Slot ,
301- ) => ( adUnitCode : string ) => boolean ,
297+ customSlotMatching ?: ( slot : unknown ) => unknown ,
302298 ) => void ;
303299 getEvents : ( ) => PrebidEvent [ ] ;
304300 } ;
@@ -430,7 +426,6 @@ const initialise = (window: Window, consentState: ConsentState): void => {
430426 timeoutBuffer,
431427 priceGranularity,
432428 userSync,
433- useBidCache : isSwitchedOn ( 'prebidBidCache' ) ,
434429 } ,
435430 ) ;
436431
@@ -622,34 +617,14 @@ const initialise = (window: Window, consentState: ConsentState): void => {
622617 } ) ;
623618} ;
624619
625- /**
626- * Creates a slot matching function for Prebid to match GPT slots with their corresponding ad units
627- * @param slot The googletag slot to find a matching advert for
628- * @returns A function that takes an adUnitCode and returns true if the slot's corresponding advert has a matching prebidAdUnit
629- * @see https://docs.prebid.org/dev-docs/publisher-api-reference/setTargetingForGPTAsync.html#custom-slot-matching
630- */
631- const customSlotMatching = ( slot : googletag . Slot ) => {
632- return function ( adUnitCode : string ) {
633- const advert = getAdvertById ( slot . getSlotElementId ( ) ) ;
634- return advert ?. prebidAdUnit === adUnitCode ;
635- } ;
636- } ;
637-
638620const bidsBackHandler = (
639621 adUnits : PrebidAdUnit [ ] ,
640622 eventTimer : EventTimer ,
641623) : Promise < void > =>
642624 new Promise ( ( resolve ) => {
643- if ( shouldIncludePrebidAdUnit ) {
644- window . pbjs ?. setTargetingForGPTAsync (
645- adUnits . map ( ( u ) => u . code ) . filter ( isString ) ,
646- customSlotMatching ,
647- ) ;
648- } else {
649- window . pbjs ?. setTargetingForGPTAsync (
650- adUnits . map ( ( u ) => u . code ) . filter ( isString ) ,
651- ) ;
652- }
625+ window . pbjs ?. setTargetingForGPTAsync (
626+ adUnits . map ( ( u ) => u . code ) . filter ( isString ) ,
627+ ) ;
653628
654629 resolve ( ) ;
655630
0 commit comments