@@ -50,9 +50,11 @@ import { isWebdriverEnabled } from '../libraries/webdriver/webdriver.js';
5050 * @typedef {BidRequest & AdditionalBidRequestFields } ExtendedBidRequest
5151 */
5252
53+ const BIDDER_DOMAIN = 'yandex.com' ;
54+
5355const BIDDER_CODE = 'yandex' ;
54- const BIDDER_URL = 'https://yandex.ru /ads/prebid' ;
55- const EVENT_TRACKER_URL = 'https://yandex.ru /ads/trace' ;
56+ const BIDDER_URL = '/ads/prebid' ;
57+ const EVENT_TRACKER_URL = '/ads/trace' ;
5658// We send data in 1% of cases
5759const DEFAULT_SAMPLING_RATE = 0.01 ;
5860const EVENT_LOG_RANDOM_NUMBER = Math . random ( ) ;
@@ -70,7 +72,7 @@ const ORTB_MTYPES = {
7072} ;
7173
7274const SSP_ID = 10500 ;
73- const ADAPTER_VERSION = '2.8 .0' ;
75+ const ADAPTER_VERSION = '2.9 .0' ;
7476
7577const TRACKER_METHODS = {
7678 img : 1 ,
@@ -164,11 +166,14 @@ export const spec = {
164166
165167 const { pageId, impId } = extractPlacementIds ( params ) ;
166168
169+ const domain = getBidderDomain ( ) ;
170+
167171 const queryParams = {
168172 'imp-id' : impId ,
169173 'target-ref' : targetRef || ortb2 ?. site ?. domain ,
170174 'adapter-version' : ADAPTER_VERSION ,
171175 'ssp-id' : SSP_ID ,
176+ domain,
172177 } ;
173178
174179 const gdprApplies = Boolean ( deepAccess ( bidderRequest , 'gdprConsent.gdprApplies' ) ) ;
@@ -247,7 +252,7 @@ export const spec = {
247252
248253 const request = {
249254 method : 'POST' ,
250- url : BIDDER_URL + ` /${ pageId } ?${ queryParamsString } `,
255+ url : `https:// ${ domain } ${ BIDDER_URL } /${ pageId } ?${ queryParamsString } `,
251256 data,
252257 options : {
253258 withCredentials,
@@ -287,10 +292,7 @@ export const spec = {
287292 } ,
288293 onBidderError : function ( { error, bidderRequest } ) {
289294 eventLog ( 'PREBID_BIDDER_ERROR_EVENT' , {
290- error : {
291- message : error ?. reason ?. message ,
292- stack : error ?. reason ?. stack ,
293- } ,
295+ error,
294296 bidderRequest,
295297 } ) ;
296298 } ,
@@ -636,10 +638,17 @@ function eventLog(name, resp) {
636638 data : resp ,
637639 } ;
638640
639- ajax ( EVENT_TRACKER_URL , undefined , JSON . stringify ( data ) , { method : 'POST' , withCredentials : true } ) ;
641+ const domain = getBidderDomain ( ) ;
642+
643+ ajax ( `https://${ domain } ${ EVENT_TRACKER_URL } ` , undefined , JSON . stringify ( data ) , { method : 'POST' , withCredentials : true } ) ;
640644 }
641645}
642646
647+ function getBidderDomain ( ) {
648+ const bidderConfig = pbjsConfig . getConfig ( ) ;
649+ return bidderConfig ?. yandex ?. domain ?? BIDDER_DOMAIN ;
650+ }
651+
643652/**
644653 * Determines the appropriate window context for a given DOM element by checking
645654 * its presence in the current window's DOM or the top-level window's DOM.
0 commit comments