From f40967e01c0133534f1d90184d0dfdde730df09f Mon Sep 17 00:00:00 2001 From: PawResz Date: Mon, 3 Aug 2026 14:27:58 +0200 Subject: [PATCH 01/17] Mateusz Adapter's fix --- modules/allegroBidAdapter.js | 89 +++++++++++++----------------------- modules/allegroBidAdapter.md | 48 +++++-------------- 2 files changed, 45 insertions(+), 92 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 67f337531b7..e08e9d89754 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -1,14 +1,14 @@ // jshint esversion: 6, es3: false, node: true 'use strict'; -import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js'; -import { ortbConverter } from '../libraries/ortbConverter/converter.js'; -import { config } from '../src/config.js'; -import { triggerPixel, logInfo, logError } from '../src/utils.js'; +import {registerBidder} from '../src/adapters/bidderFactory.js'; +import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js'; +import {ortbConverter} from '../libraries/ortbConverter/converter.js'; +import {config} from '../src/config.js'; +import {triggerPixel, logInfo, logError} from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; +const BIDDER_URL = 'https://prebid.rtb.allegrogroup.com/v1/rtb/prebid/bid'; const GVLID = 1493; /** @@ -23,44 +23,44 @@ function convertExtensionFields(request) { if (request.imp) { request.imp.forEach(imp => { if (imp.banner?.ext) { - moveExt(imp.banner, '[com.google.doubleclick.banner_ext]'); + moveExt(imp.banner, '[com.google.doubleclick.banner_ext]') } if (imp.ext) { - moveExt(imp, '[com.google.doubleclick.imp]'); + moveExt(imp, '[com.google.doubleclick.imp]') } }); } if (request.app?.ext) { - moveExt(request.app, '[com.google.doubleclick.app]'); + moveExt(request.app, '[com.google.doubleclick.app]') } if (request.site?.ext) { - moveExt(request.site, '[com.google.doubleclick.site]'); + moveExt(request.site, '[com.google.doubleclick.site]') } if (request.site?.publisher?.ext) { - moveExt(request.site.publisher, '[com.google.doubleclick.publisher]'); + moveExt(request.site.publisher, '[com.google.doubleclick.publisher]') } if (request.user?.ext) { - moveExt(request.user, '[com.google.doubleclick.user]'); + moveExt(request.user, '[com.google.doubleclick.user]') } if (request.user?.data) { request.user.data.forEach(data => { if (data.ext) { - moveExt(data, '[com.google.doubleclick.data]'); + moveExt(data, '[com.google.doubleclick.data]') } }); } if (request.device?.ext) { - moveExt(request.device, '[com.google.doubleclick.device]'); + moveExt(request.device, '[com.google.doubleclick.device]') } if (request.device?.geo?.ext) { - moveExt(request.device.geo, '[com.google.doubleclick.geo]'); + moveExt(request.device.geo, '[com.google.doubleclick.geo]') } if (request.regs?.ext) { @@ -68,15 +68,15 @@ function convertExtensionFields(request) { request.regs.ext.gdpr = request.regs.ext.gdpr === 1; } - moveExt(request.regs, '[com.google.doubleclick.regs]'); + moveExt(request.regs, '[com.google.doubleclick.regs]') } if (request.source?.ext) { - moveExt(request.source, '[com.google.doubleclick.source]'); + moveExt(request.source, '[com.google.doubleclick.source]') } if (request.ext) { - moveExt(request, '[com.google.doubleclick.bid_request]'); + moveExt(request, '[com.google.doubleclick.bid_request]') } } @@ -91,7 +91,7 @@ function moveExt(obj, newKey) { if (!obj || !obj.ext) { return; } - const extCopy = { ...obj.ext }; + const extCopy = {...obj.ext}; delete obj.ext; obj[newKey] = extCopy; } @@ -163,39 +163,8 @@ const converter = ortbConverter({ } return request; - }, - - /** - * Post-processes each Prebid bid response, mapping Allegro DSP extension - * fields onto the standard `meta` object so publishers can consume them. - * The DSP extension is delivered as a proto-JSON bracketed key - * (`[com.allegro.dsp.dsp_bid]`). `adomain` is mapped to - * `meta.advertiserDomains` by the default ORTB processor. - * - * @param {Function} buildBidResponse Base builder provided by ortbConverter. - * @param bid Single ORTB bid object from the server response. - * @param context Shared converter context. - * @returns {Object} Prebid bid response object. - */ - bidResponse(buildBidResponse, bid, context) { - const bidResponse = buildBidResponse(bid, context); - if (bidResponse == null) { - return bidResponse; - } - bidResponse.meta = bidResponse.meta || {}; - - // Support both ORTB ext nesting and proto-json top-level extension key. - const dspBidExt = bid.ext?.['[com.allegro.dsp.dsp_bid]'] ?? bid['[com.allegro.dsp.dsp_bid]']; - if (dspBidExt?.clientId !== undefined) { - bidResponse.meta.advertiserId = dspBidExt.clientId; - } - if (dspBidExt?.productId !== undefined) { - bidResponse.meta.productId = dspBidExt.productId; - } - - return bidResponse; } -}); +}) /** * Validates supply chain object structure @@ -244,15 +213,23 @@ export const spec = { */ buildRequests: function (bidRequests, bidderRequest) { const url = config.getConfig('allegro.bidderUrl') || BIDDER_URL; + const data = converter.toORTB({bidderRequest, bidRequests}); + + const gwpPb = bidRequests.find(br => br.params?.publisherId)?.params?.publisherId; + if (gwpPb) { + if (!data.site) data.site = {}; + if (!data.site.publisher) data.site.publisher = {}; + data.site.publisher.id = gwpPb; + } return { method: 'POST', url: url, - data: converter.toORTB({ bidderRequest, bidRequests }), + data, options: { contentType: 'text/plain' }, - }; + } }, /** @@ -263,7 +240,7 @@ export const spec = { */ interpretResponse: function (response, request) { if (!response.body) return; - return converter.fromORTB({ response: response.body, request: request.data }).bids; + return converter.fromORTB({response: response.body, request: request.data}).bids; }, /** @@ -283,6 +260,6 @@ export const spec = { } } -}; +} -registerBidder(spec); +registerBidder(spec); \ No newline at end of file diff --git a/modules/allegroBidAdapter.md b/modules/allegroBidAdapter.md index 252c5427873..bfc3d25c1e8 100644 --- a/modules/allegroBidAdapter.md +++ b/modules/allegroBidAdapter.md @@ -23,7 +23,7 @@ The Allegro adapter supports the following configuration options: | Name | Scope | Type | Description | Default | |----------------------------------|----------|---------|-----------------------------------------------------------------------------|---------------------------------------------------------| -| `allegro.bidderUrl` | optional | String | Custom bidder endpoint URL | `https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid` | +| `allegro.bidderUrl` | optional | String | Custom bidder endpoint URL | `https://prebid.rtb.allegrogroup.com/v1/rtb/prebid/bid` | | `allegro.convertExtensionFields` | optional | Boolean | Enable/disable conversion of OpenRTB extension fields to DoubleClick format | `true` | | `allegro.triggerImpressionPixel` | optional | Boolean | Enable/disable triggering impression tracking pixels on bid won event | `false` | @@ -54,53 +54,29 @@ var adUnits = [{ } }, bids: [{ - bidder: 'allegro' + bidder: 'allegro', + params: { + publisherId: 'gwp' // publisher identifier; maps to site.publisher.id in the outgoing OpenRTB request + } }] }]; ``` +## Bid Request Parameters + +| Name | Scope | Type | Description | +|----------|----------|--------|-------------------------------------------------------------------------------------------------------------------------| +| `publisherId` | optional | String | Publisher identifier. When present, the value is written to `site.publisher.id` in the outgoing OpenRTB bid request, enabling publisher-scoped bid entity filtering on the server side. | + + # Features ## Impression Tracking When `allegro.triggerImpressionPixel` is enabled, the adapter will automatically fire the provided `burl` (billing/impression) tracking URL when a bid wins. -## Bid Metadata - -The adapter exposes advertiser metadata from the bid response on the standard `bid.meta` object: - -| `bid.meta` field | Source in OpenRTB bid response | Description | -|---------------------|------------------------------------------------------------------------------------------------|-----------------------| -| `advertiserDomains` | `bid.adomain` | Advertiser domain(s) | -| `advertiserId` | `bid.ext['[com.allegro.dsp.dsp_bid]'].clientId` or `bid['[com.allegro.dsp.dsp_bid]'].clientId` | Advertiser identifier | -| `productId` | `bid.ext['[com.allegro.dsp.dsp_bid]'].productId` or `bid['[com.allegro.dsp.dsp_bid]'].productId` | Product identifier | - -The DSP extension fields are delivered as a proto-JSON bracketed key (`[com.allegro.dsp.dsp_bid]`) and may appear either under `bid.ext` or as a top-level proto-JSON key (`bid['[com.allegro.dsp.dsp_bid]']`). - -Example server bid response: - -```json -{ - "seatbid": [{ - "bid": [{ - "impid": "abc", - "price": 1.5, - "adomain": ["advertiser.com"], - "ext": { - "[com.allegro.dsp.dsp_bid]": { - "clientId": "42", - "productId": "prod-123" - } - } - }] - }], - "cur": "USD" -} -``` - # Technical Details - **Protocol**: OpenRTB 2.5 - **TTL**: 360 seconds - **Net Revenue**: true - **Content Type**: text/plain - From 6bb8a93a5dc226adfa6c17276f3455fff3e55ff0 Mon Sep 17 00:00:00 2001 From: PawResz Date: Tue, 4 Aug 2026 09:37:14 +0200 Subject: [PATCH 02/17] linter --- modules/allegroBidAdapter.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index e08e9d89754..6cda8f281f3 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -1,11 +1,11 @@ // jshint esversion: 6, es3: false, node: true 'use strict'; -import {registerBidder} from '../src/adapters/bidderFactory.js'; -import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js'; -import {ortbConverter} from '../libraries/ortbConverter/converter.js'; -import {config} from '../src/config.js'; -import {triggerPixel, logInfo, logError} from '../src/utils.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js'; +import { ortbConverter } from '../libraries/ortbConverter/converter.js'; +import { config } from '../src/config.js'; +import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; const BIDDER_URL = 'https://prebid.rtb.allegrogroup.com/v1/rtb/prebid/bid'; @@ -91,7 +91,7 @@ function moveExt(obj, newKey) { if (!obj || !obj.ext) { return; } - const extCopy = {...obj.ext}; + const extCopy = { ...obj.ext }; delete obj.ext; obj[newKey] = extCopy; } From 041325f44886e0de5006b48adab2b8b4929b143e Mon Sep 17 00:00:00 2001 From: PawResz Date: Tue, 4 Aug 2026 09:54:51 +0200 Subject: [PATCH 03/17] lint & merge --- modules/allegroBidAdapter.js | 55 ++++++++++++++++++++++++++++-------- modules/allegroBidAdapter.md | 34 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 6cda8f281f3..d86abd3c8d0 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -23,28 +23,28 @@ function convertExtensionFields(request) { if (request.imp) { request.imp.forEach(imp => { if (imp.banner?.ext) { - moveExt(imp.banner, '[com.google.doubleclick.banner_ext]') + moveExt(imp.banner, '[com.google.doubleclick.banner_ext]'); } if (imp.ext) { - moveExt(imp, '[com.google.doubleclick.imp]') + moveExt(imp, '[com.google.doubleclick.imp]'); } }); } if (request.app?.ext) { - moveExt(request.app, '[com.google.doubleclick.app]') + moveExt(request.app, '[com.google.doubleclick.app]'); } if (request.site?.ext) { - moveExt(request.site, '[com.google.doubleclick.site]') + moveExt(request.site, '[com.google.doubleclick.site]'); } if (request.site?.publisher?.ext) { - moveExt(request.site.publisher, '[com.google.doubleclick.publisher]') + moveExt(request.site.publisher, '[com.google.doubleclick.publisher]'); } if (request.user?.ext) { - moveExt(request.user, '[com.google.doubleclick.user]') + moveExt(request.user, '[com.google.doubleclick.user]'); } if (request.user?.data) { @@ -56,11 +56,11 @@ function convertExtensionFields(request) { } if (request.device?.ext) { - moveExt(request.device, '[com.google.doubleclick.device]') + moveExt(request.device, '[com.google.doubleclick.device]'); } if (request.device?.geo?.ext) { - moveExt(request.device.geo, '[com.google.doubleclick.geo]') + moveExt(request.device.geo, '[com.google.doubleclick.geo]'); } if (request.regs?.ext) { @@ -68,15 +68,15 @@ function convertExtensionFields(request) { request.regs.ext.gdpr = request.regs.ext.gdpr === 1; } - moveExt(request.regs, '[com.google.doubleclick.regs]') + moveExt(request.regs, '[com.google.doubleclick.regs]'); } if (request.source?.ext) { - moveExt(request.source, '[com.google.doubleclick.source]') + moveExt(request.source, '[com.google.doubleclick.source]'); } if (request.ext) { - moveExt(request, '[com.google.doubleclick.bid_request]') + moveExt(request, '[com.google.doubleclick.bid_request]'); } } @@ -163,8 +163,39 @@ const converter = ortbConverter({ } return request; + }, + + /** + * Post-processes each Prebid bid response, mapping Allegro DSP extension + * fields onto the standard `meta` object so publishers can consume them. + * The DSP extension is delivered as a proto-JSON bracketed key + * (`[com.allegro.dsp.dsp_bid]`). `adomain` is mapped to + * `meta.advertiserDomains` by the default ORTB processor. + * + * @param {Function} buildBidResponse Base builder provided by ortbConverter. + * @param bid Single ORTB bid object from the server response. + * @param context Shared converter context. + * @returns {Object} Prebid bid response object. + */ + bidResponse(buildBidResponse, bid, context) { + const bidResponse = buildBidResponse(bid, context); + if (bidResponse == null) { + return bidResponse; + } + bidResponse.meta = bidResponse.meta || {}; + + // Support both ORTB ext nesting and proto-json top-level extension key. + const dspBidExt = bid.ext?.['[com.allegro.dsp.dsp_bid]'] ?? bid['[com.allegro.dsp.dsp_bid]']; + if (dspBidExt?.clientId !== undefined) { + bidResponse.meta.advertiserId = dspBidExt.clientId; + } + if (dspBidExt?.productId !== undefined) { + bidResponse.meta.productId = dspBidExt.productId; + } + + return bidResponse; } -}) +}); /** * Validates supply chain object structure diff --git a/modules/allegroBidAdapter.md b/modules/allegroBidAdapter.md index bfc3d25c1e8..d250759d98e 100644 --- a/modules/allegroBidAdapter.md +++ b/modules/allegroBidAdapter.md @@ -74,6 +74,40 @@ var adUnits = [{ When `allegro.triggerImpressionPixel` is enabled, the adapter will automatically fire the provided `burl` (billing/impression) tracking URL when a bid wins. +## Bid Metadata + +The adapter exposes advertiser metadata from the bid response on the standard `bid.meta` object: + +| `bid.meta` field | Source in OpenRTB bid response | Description | +|---------------------|------------------------------------------------------------------------------------------------|-----------------------| +| `advertiserDomains` | `bid.adomain` | Advertiser domain(s) | +| `advertiserId` | `bid.ext['[com.allegro.dsp.dsp_bid]'].clientId` or `bid['[com.allegro.dsp.dsp_bid]'].clientId` | Advertiser identifier | +| `productId` | `bid.ext['[com.allegro.dsp.dsp_bid]'].productId` or `bid['[com.allegro.dsp.dsp_bid]'].productId` | Product identifier | + +The DSP extension fields are delivered as a proto-JSON bracketed key (`[com.allegro.dsp.dsp_bid]`) and may appear either under `bid.ext` or as a top-level proto-JSON key (`bid['[com.allegro.dsp.dsp_bid]']`). + +Example server bid response: + +```json +{ + "seatbid": [{ + "bid": [{ + "impid": "abc", + "price": 1.5, + "adomain": ["advertiser.com"], + "ext": { + "[com.allegro.dsp.dsp_bid]": { + "clientId": "42", + "productId": "prod-123" + } + } + }] + }], + "cur": "USD" +} +``` + + # Technical Details - **Protocol**: OpenRTB 2.5 From 205f58720a08d84adfef7a74342ad8e5ecee4372 Mon Sep 17 00:00:00 2001 From: PawResz Date: Tue, 4 Aug 2026 09:59:11 +0200 Subject: [PATCH 04/17] lint & merge 2 --- modules/allegroBidAdapter.js | 10 +++++----- modules/allegroBidAdapter.md | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index d86abd3c8d0..8119fa8bbf9 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -8,7 +8,7 @@ import { config } from '../src/config.js'; import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'https://prebid.rtb.allegrogroup.com/v1/rtb/prebid/bid'; +const BIDDER_URL = 'https://prebid.rtb.allegro.com/v1/rtb/prebid/bid'; const GVLID = 1493; /** @@ -50,7 +50,7 @@ function convertExtensionFields(request) { if (request.user?.data) { request.user.data.forEach(data => { if (data.ext) { - moveExt(data, '[com.google.doubleclick.data]') + moveExt(data, '[com.google.doubleclick.data]'); } }); } @@ -260,7 +260,7 @@ export const spec = { options: { contentType: 'text/plain' }, - } + }; }, /** @@ -271,7 +271,7 @@ export const spec = { */ interpretResponse: function (response, request) { if (!response.body) return; - return converter.fromORTB({response: response.body, request: request.data}).bids; + return converter.fromORTB({ response: response.body, request: request.data }).bids; }, /** @@ -293,4 +293,4 @@ export const spec = { } -registerBidder(spec); \ No newline at end of file +registerBidder(spec); diff --git a/modules/allegroBidAdapter.md b/modules/allegroBidAdapter.md index d250759d98e..addccc53ecb 100644 --- a/modules/allegroBidAdapter.md +++ b/modules/allegroBidAdapter.md @@ -23,7 +23,7 @@ The Allegro adapter supports the following configuration options: | Name | Scope | Type | Description | Default | |----------------------------------|----------|---------|-----------------------------------------------------------------------------|---------------------------------------------------------| -| `allegro.bidderUrl` | optional | String | Custom bidder endpoint URL | `https://prebid.rtb.allegrogroup.com/v1/rtb/prebid/bid` | +| `allegro.bidderUrl` | optional | String | Custom bidder endpoint URL | `https://prebid.rtb.allegro.com/v1/rtb/prebid/bid` | | `allegro.convertExtensionFields` | optional | Boolean | Enable/disable conversion of OpenRTB extension fields to DoubleClick format | `true` | | `allegro.triggerImpressionPixel` | optional | Boolean | Enable/disable triggering impression tracking pixels on bid won event | `false` | @@ -107,7 +107,6 @@ Example server bid response: } ``` - # Technical Details - **Protocol**: OpenRTB 2.5 From 0413e93853b716da7f2fc49eae499b8eff1f7263 Mon Sep 17 00:00:00 2001 From: PawResz Date: Tue, 4 Aug 2026 10:03:36 +0200 Subject: [PATCH 05/17] polishing --- modules/allegroBidAdapter.js | 6 +++--- modules/allegroBidAdapter.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 8119fa8bbf9..499c33bf786 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -8,7 +8,7 @@ import { config } from '../src/config.js'; import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'https://prebid.rtb.allegro.com/v1/rtb/prebid/bid'; +const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; const GVLID = 1493; /** @@ -244,7 +244,7 @@ export const spec = { */ buildRequests: function (bidRequests, bidderRequest) { const url = config.getConfig('allegro.bidderUrl') || BIDDER_URL; - const data = converter.toORTB({bidderRequest, bidRequests}); + const data = converter.toORTB({ bidderRequest, bidRequests }); const gwpPb = bidRequests.find(br => br.params?.publisherId)?.params?.publisherId; if (gwpPb) { @@ -291,6 +291,6 @@ export const spec = { } } -} +}; registerBidder(spec); diff --git a/modules/allegroBidAdapter.md b/modules/allegroBidAdapter.md index addccc53ecb..62845816f17 100644 --- a/modules/allegroBidAdapter.md +++ b/modules/allegroBidAdapter.md @@ -23,7 +23,7 @@ The Allegro adapter supports the following configuration options: | Name | Scope | Type | Description | Default | |----------------------------------|----------|---------|-----------------------------------------------------------------------------|---------------------------------------------------------| -| `allegro.bidderUrl` | optional | String | Custom bidder endpoint URL | `https://prebid.rtb.allegro.com/v1/rtb/prebid/bid` | +| `allegro.bidderUrl` | optional | String | Custom bidder endpoint URL | `https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid` | | `allegro.convertExtensionFields` | optional | Boolean | Enable/disable conversion of OpenRTB extension fields to DoubleClick format | `true` | | `allegro.triggerImpressionPixel` | optional | Boolean | Enable/disable triggering impression tracking pixels on bid won event | `false` | From f78ef3d76afc0436b6d857583f72bc62cc8efa2b Mon Sep 17 00:00:00 2001 From: PawResz Date: Tue, 4 Aug 2026 11:48:29 +0200 Subject: [PATCH 06/17] new form --- modules/allegroBidAdapter.js | 13 ++++++------- test/spec/modules/allegroBidAdapter_spec.js | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 499c33bf786..f0367f8091e 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -140,6 +140,12 @@ const converter = ortbConverter({ request(buildRequest, imps, bidderRequest, context) { const request = buildRequest(imps, bidderRequest, context); + const publisherId = bidderRequest.bids.find(bid => bid.params?.publisherId)?.params.publisherId; + if (publisherId) { + request.site = request.site || {}; + request.site['[com.allegro.dsp.site.ext]'] = { inventory: { id: publisherId } }; + } + if (request?.device?.dnt !== undefined) { request.device.dnt = request.device.dnt === 1; } @@ -246,13 +252,6 @@ export const spec = { const url = config.getConfig('allegro.bidderUrl') || BIDDER_URL; const data = converter.toORTB({ bidderRequest, bidRequests }); - const gwpPb = bidRequests.find(br => br.params?.publisherId)?.params?.publisherId; - if (gwpPb) { - if (!data.site) data.site = {}; - if (!data.site.publisher) data.site.publisher = {}; - data.site.publisher.id = gwpPb; - } - return { method: 'POST', url: url, diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index 3134850b645..d75ffcae036 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -75,7 +75,7 @@ describe('Allegro Bid Adapter', () => { it('converts extension fields by default', () => { sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const bidRequests = [buildBidRequest({})]; + const bidRequests = [buildBidRequest({ params: { publisherId: 'gwp_pb' } })]; const ortb2 = { site: { ext: { siteCustom: 'val' }, publisher: { ext: { pubCustom: 'pub' } } }, user: { ext: { userCustom: 'usr' }, data: [{ ext: { dataCustom: 'd1' } }] }, @@ -90,6 +90,7 @@ describe('Allegro Bid Adapter', () => { expect(data.site.ext).to.equal(undefined); expect(data.site['[com.google.doubleclick.site]'].siteCustom).to.equal('val'); + expect(data.site['[com.allegro.dsp.site.ext]'].inventory.id).to.equal('gwp_pb'); expect(data.site.publisher['[com.google.doubleclick.publisher]'].pubCustom).to.equal('pub'); expect(data.user['[com.google.doubleclick.user]'].userCustom).to.equal('usr'); expect(data.user.data[0]['[com.google.doubleclick.data]'].dataCustom).to.equal('d1'); @@ -113,6 +114,23 @@ describe('Allegro Bid Adapter', () => { expect(req.data.site['[com.google.doubleclick.site]']).to.equal(undefined); }); + it('does not add the inventory extension when publisherId is absent', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const bidRequests = [buildBidRequest({})]; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests)); + expect(req.data.site?.['[com.allegro.dsp.site.ext]']).to.equal(undefined); + }); + + it('sets inventory.id even when allegro.convertExtensionFields = false', () => { + sinon.stub(config, 'getConfig').callsFake((key) => { + if (key === 'allegro.convertExtensionFields') return false; + return undefined; + }); + const bidRequests = [buildBidRequest({ params: { publisherId: 'gwp_pb' } })]; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests)); + expect(req.data.site['[com.allegro.dsp.site.ext]'].inventory.id).to.equal('gwp_pb'); + }); + it('converts numeric flags to booleans (topframe, secure, test) when present', () => { sinon.stub(config, 'getConfig').callsFake((key) => undefined); const bidRequests = [buildBidRequest({ mediaTypes: { banner: { sizes: [[300, 250]], topframe: 1 } }, params: { secure: 1 } })]; From fdd188252c63a9d34721e95d1a9c1c047f328ba9 Mon Sep 17 00:00:00 2001 From: PawResz Date: Tue, 4 Aug 2026 12:01:05 +0200 Subject: [PATCH 07/17] docks --- modules/allegroBidAdapter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/allegroBidAdapter.md b/modules/allegroBidAdapter.md index 62845816f17..7fcaeb5f570 100644 --- a/modules/allegroBidAdapter.md +++ b/modules/allegroBidAdapter.md @@ -56,7 +56,7 @@ var adUnits = [{ bids: [{ bidder: 'allegro', params: { - publisherId: 'gwp' // publisher identifier; maps to site.publisher.id in the outgoing OpenRTB request + publisherId: 'gwp' // publisher identifier; maps to site.[com.allegro.dsp.site.ext].inventory.id in the outgoing OpenRTB request } }] }]; @@ -66,7 +66,7 @@ var adUnits = [{ | Name | Scope | Type | Description | |----------|----------|--------|-------------------------------------------------------------------------------------------------------------------------| -| `publisherId` | optional | String | Publisher identifier. When present, the value is written to `site.publisher.id` in the outgoing OpenRTB bid request, enabling publisher-scoped bid entity filtering on the server side. | +| `publisherId` | optional | String | Publisher identifier. When present, the value is written to the `[com.allegro.dsp.site.ext]` proto-JSON extension key on `site` as `inventory.id` in the outgoing OpenRTB bid request, enabling publisher-scoped bid entity filtering on the server side. | # Features From 5de679de9cdf99ce6725b0433f91a8826350cbe3 Mon Sep 17 00:00:00 2001 From: PawResz Date: Thu, 6 Aug 2026 08:47:42 +0200 Subject: [PATCH 08/17] more_tests --- test/spec/modules/allegroBidAdapter_spec.js | 69 ++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index d75ffcae036..4e1dcf10a7d 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -4,13 +4,14 @@ import { config } from 'src/config.js'; import sinon from 'sinon'; import * as utils from 'src/utils.js'; -function buildBidRequest({ bidId = 'bid1', adUnitCode = 'div-1', sizes = [[300, 250]], params = {}, mediaTypes } = {}) { +function buildBidRequest({ bidId = 'bid1', adUnitCode = 'div-1', sizes = [[300, 250]], params = {}, mediaTypes, ortb2Imp } = {}) { return { bidId, adUnitCode, bidder: 'allegro', params, mediaTypes: mediaTypes || { banner: { sizes } }, + ...(ortb2Imp ? { ortb2Imp } : {}), }; } @@ -146,6 +147,72 @@ describe('Allegro Bid Adapter', () => { expect(imp.secure).to.equal(true); expect(req.data.test).to.equal(true); }); + + it('converts imp and imp.banner extension fields', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const bidRequests = [buildBidRequest({ + ortb2Imp: { + ext: { impCustom: 'imp' }, + banner: { ext: { bannerCustom: 'ban' } } + } + })]; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests)); + const imp = req.data.imp[0]; + expect(imp.ext).to.equal(undefined); + expect(imp['[com.google.doubleclick.imp]'].impCustom).to.equal('imp'); + expect(imp.banner.ext).to.equal(undefined); + expect(imp.banner['[com.google.doubleclick.banner_ext]'].bannerCustom).to.equal('ban'); + }); + + it('converts app and device.geo extension fields', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const bidRequests = [buildBidRequest({})]; + const ortb2 = { + app: { ext: { appCustom: 'app' } }, + device: { geo: { ext: { geoCustom: 'geo' } } } + }; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); + const data = req.data; + expect(data.app.ext).to.equal(undefined); + expect(data.app['[com.google.doubleclick.app]'].appCustom).to.equal('app'); + expect(data.device.geo.ext).to.equal(undefined); + expect(data.device.geo['[com.google.doubleclick.geo]'].geoCustom).to.equal('geo'); + }); + + it('keeps a valid supply chain on the request', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const bidRequests = [buildBidRequest({})]; + const ortb2 = { source: { schain: { ver: '1.0', nodes: [{ asi: 'a.com', sid: '1', hp: 1 }] } } }; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); + expect(req.data.source.schain).to.exist; + expect(req.data.source.schain.nodes).to.have.lengthOf(1); + }); + + it('drops a supply chain whose nodes miss required fields', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const bidRequests = [buildBidRequest({})]; + const ortb2 = { source: { schain: { nodes: [{ asi: 'a.com' }] } } }; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); + expect(req.data.source.schain).to.equal(undefined); + }); + + it('drops a supply chain that has no nodes array', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const bidRequests = [buildBidRequest({})]; + const ortb2 = { source: { schain: { ver: '1.0' } } }; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); + expect(req.data.source.schain).to.equal(undefined); + }); + + it('drops a supply chain when node validation throws', () => { + sinon.stub(config, 'getConfig').callsFake((key) => undefined); + const errorStub = sinon.stub(utils, 'logError'); + const bidRequests = [buildBidRequest({})]; + const ortb2 = { source: { schain: { nodes: [null] } } }; + const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); + expect(req.data.source.schain).to.equal(undefined); + expect(errorStub.called).to.equal(true); + }); }); describe('interpretResponse', () => { From cd2a764fd16c3b1cca22d8efb07f83e872e41df1 Mon Sep 17 00:00:00 2001 From: PawResz Date: Thu, 6 Aug 2026 09:06:24 +0200 Subject: [PATCH 09/17] more_more_tests --- test/spec/modules/allegroBidAdapter_spec.js | 48 ++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index 4e1dcf10a7d..e21c9e0c32b 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { spec } from 'modules/allegroBidAdapter.js'; +import { spec, moveExt, mapBidResponse } from 'modules/allegroBidAdapter.js'; import { config } from 'src/config.js'; import sinon from 'sinon'; import * as utils from 'src/utils.js'; @@ -351,5 +351,51 @@ describe('Allegro Bid Adapter', () => { const calledWith = pixelSpy.getCall(0).args[0]; expect(calledWith).to.equal(bid.burl); }); + + it('logs the winning bid when debug is enabled', () => { + const infoStub = sinon.stub(utils, 'logInfo'); + sinon.stub(config, 'getConfig').callsFake((key) => { + if (key === 'debug') return true; + return undefined; + }); + const bid = { adId: 'ad-1', cpm: 1.5 }; + spec.onBidWon(bid); + expect(infoStub.calledWith('bid won', bid)).to.equal(true); + }); + }); + + describe('moveExt', () => { + it('does nothing when the object is missing', () => { + expect(() => moveExt(undefined, '[com.google.doubleclick.site]')).to.not.throw(); + }); + + it('does nothing when the object has no ext', () => { + const obj = { foo: 'bar' }; + moveExt(obj, '[com.google.doubleclick.site]'); + expect(obj).to.deep.equal({ foo: 'bar' }); + expect(obj['[com.google.doubleclick.site]']).to.equal(undefined); + }); + + it('moves ext into the bracketed key', () => { + const obj = { ext: { custom: 'v' } }; + moveExt(obj, '[com.google.doubleclick.site]'); + expect(obj.ext).to.equal(undefined); + expect(obj['[com.google.doubleclick.site]']).to.deep.equal({ custom: 'v' }); + }); + }); + + describe('mapBidResponse', () => { + it('returns the response unchanged when the base builder yields null', () => { + const result = mapBidResponse(() => null, {}, {}); + expect(result).to.equal(null); + }); + + it('maps DSP extension fields onto meta from the proto-json key', () => { + const bid = { '[com.allegro.dsp.dsp_bid]': { clientId: '42', productId: 'prod-1' } }; + const result = mapBidResponse(() => ({}), bid, {}); + expect(result.meta.advertiserId).to.equal('42'); + expect(result.meta.productId).to.equal('prod-1'); + }); }); }); + From b77a7bf0e4930323a00f350b9a12ec8329bcc04a Mon Sep 17 00:00:00 2001 From: PawResz Date: Thu, 6 Aug 2026 09:29:36 +0200 Subject: [PATCH 10/17] Allegro Bid Adapter: export moveExt and mapBidResponse for tests --- modules/allegroBidAdapter.js | 63 +++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index f0367f8091e..0dafd0c2740 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -8,7 +8,8 @@ import { config } from '../src/config.js'; import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; +const BIDDER_URL = 'http://localhost:9180/v1/rtb/prebid/bid'; +// const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; const GVLID = 1493; /** @@ -87,7 +88,7 @@ function convertExtensionFields(request) { * @param obj The object potentially containing `ext`. * @param {string} newKey The destination key name (e.g. '[com.google.doubleclick.site]'). */ -function moveExt(obj, newKey) { +export function moveExt(obj, newKey) { if (!obj || !obj.ext) { return; } @@ -171,37 +172,39 @@ const converter = ortbConverter({ return request; }, - /** - * Post-processes each Prebid bid response, mapping Allegro DSP extension - * fields onto the standard `meta` object so publishers can consume them. - * The DSP extension is delivered as a proto-JSON bracketed key - * (`[com.allegro.dsp.dsp_bid]`). `adomain` is mapped to - * `meta.advertiserDomains` by the default ORTB processor. - * - * @param {Function} buildBidResponse Base builder provided by ortbConverter. - * @param bid Single ORTB bid object from the server response. - * @param context Shared converter context. - * @returns {Object} Prebid bid response object. - */ - bidResponse(buildBidResponse, bid, context) { - const bidResponse = buildBidResponse(bid, context); - if (bidResponse == null) { - return bidResponse; - } - bidResponse.meta = bidResponse.meta || {}; - - // Support both ORTB ext nesting and proto-json top-level extension key. - const dspBidExt = bid.ext?.['[com.allegro.dsp.dsp_bid]'] ?? bid['[com.allegro.dsp.dsp_bid]']; - if (dspBidExt?.clientId !== undefined) { - bidResponse.meta.advertiserId = dspBidExt.clientId; - } - if (dspBidExt?.productId !== undefined) { - bidResponse.meta.productId = dspBidExt.productId; - } + bidResponse: mapBidResponse +}); +/** + * Post-processes each Prebid bid response, mapping Allegro DSP extension + * fields onto the standard `meta` object so publishers can consume them. + * The DSP extension is delivered as a proto-JSON bracketed key + * (`[com.allegro.dsp.dsp_bid]`). `adomain` is mapped to + * `meta.advertiserDomains` by the default ORTB processor. + * + * @param {Function} buildBidResponse Base builder provided by ortbConverter. + * @param bid Single ORTB bid object from the server response. + * @param context Shared converter context. + * @returns {Object} Prebid bid response object. + */ +export function mapBidResponse(buildBidResponse, bid, context) { + const bidResponse = buildBidResponse(bid, context); + if (bidResponse == null) { return bidResponse; } -}); + bidResponse.meta = bidResponse.meta || {}; + + // Support both ORTB ext nesting and proto-json top-level extension key. + const dspBidExt = bid.ext?.['[com.allegro.dsp.dsp_bid]'] ?? bid['[com.allegro.dsp.dsp_bid]']; + if (dspBidExt?.clientId !== undefined) { + bidResponse.meta.advertiserId = dspBidExt.clientId; + } + if (dspBidExt?.productId !== undefined) { + bidResponse.meta.productId = dspBidExt.productId; + } + + return bidResponse; +} /** * Validates supply chain object structure From b07283518e27ca75da222e4c76e803c6b1320756 Mon Sep 17 00:00:00 2001 From: PawResz Date: Thu, 6 Aug 2026 09:36:44 +0200 Subject: [PATCH 11/17] rm copilot changes --- modules/allegroBidAdapter.js | 67 +++++++++++++++++------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 0dafd0c2740..0c1d21bd784 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -8,8 +8,7 @@ import { config } from '../src/config.js'; import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'http://localhost:9180/v1/rtb/prebid/bid'; -// const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; +const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; const GVLID = 1493; /** @@ -88,7 +87,7 @@ function convertExtensionFields(request) { * @param obj The object potentially containing `ext`. * @param {string} newKey The destination key name (e.g. '[com.google.doubleclick.site]'). */ -export function moveExt(obj, newKey) { +function moveExt(obj, newKey) { if (!obj || !obj.ext) { return; } @@ -171,40 +170,37 @@ const converter = ortbConverter({ return request; }, + /** + * Post-processes each Prebid bid response, mapping Allegro DSP extension + * fields onto the standard `meta` object so publishers can consume them. + * The DSP extension is delivered as a proto-JSON bracketed key + * (`[com.allegro.dsp.dsp_bid]`). `adomain` is mapped to + * `meta.advertiserDomains` by the default ORTB processor. + * + * @param {Function} buildBidResponse Base builder provided by ortbConverter. + * @param bid Single ORTB bid object from the server response. + * @param context Shared converter context. + * @returns {Object} Prebid bid response object. + */ + bidResponse(buildBidResponse, bid, context) { + const bidResponse = buildBidResponse(bid, context); + if (bidResponse == null) { + return bidResponse; + } + bidResponse.meta = bidResponse.meta || {}; - bidResponse: mapBidResponse -}); + // Support both ORTB ext nesting and proto-json top-level extension key. + const dspBidExt = bid.ext?.['[com.allegro.dsp.dsp_bid]'] ?? bid['[com.allegro.dsp.dsp_bid]']; + if (dspBidExt?.clientId !== undefined) { + bidResponse.meta.advertiserId = dspBidExt.clientId; + } + if (dspBidExt?.productId !== undefined) { + bidResponse.meta.productId = dspBidExt.productId; + } -/** - * Post-processes each Prebid bid response, mapping Allegro DSP extension - * fields onto the standard `meta` object so publishers can consume them. - * The DSP extension is delivered as a proto-JSON bracketed key - * (`[com.allegro.dsp.dsp_bid]`). `adomain` is mapped to - * `meta.advertiserDomains` by the default ORTB processor. - * - * @param {Function} buildBidResponse Base builder provided by ortbConverter. - * @param bid Single ORTB bid object from the server response. - * @param context Shared converter context. - * @returns {Object} Prebid bid response object. - */ -export function mapBidResponse(buildBidResponse, bid, context) { - const bidResponse = buildBidResponse(bid, context); - if (bidResponse == null) { return bidResponse; } - bidResponse.meta = bidResponse.meta || {}; - - // Support both ORTB ext nesting and proto-json top-level extension key. - const dspBidExt = bid.ext?.['[com.allegro.dsp.dsp_bid]'] ?? bid['[com.allegro.dsp.dsp_bid]']; - if (dspBidExt?.clientId !== undefined) { - bidResponse.meta.advertiserId = dspBidExt.clientId; - } - if (dspBidExt?.productId !== undefined) { - bidResponse.meta.productId = dspBidExt.productId; - } - - return bidResponse; -} +}); /** * Validates supply chain object structure @@ -253,12 +249,11 @@ export const spec = { */ buildRequests: function (bidRequests, bidderRequest) { const url = config.getConfig('allegro.bidderUrl') || BIDDER_URL; - const data = converter.toORTB({ bidderRequest, bidRequests }); return { method: 'POST', url: url, - data, + data: converter.toORTB({ bidderRequest, bidRequests }), options: { contentType: 'text/plain' }, @@ -295,4 +290,4 @@ export const spec = { }; -registerBidder(spec); +registerBidder(spec); \ No newline at end of file From 3ea8e9a7ba8640ddba661b43ecadf7c9039f272e Mon Sep 17 00:00:00 2001 From: PawResz Date: Thu, 6 Aug 2026 09:45:58 +0200 Subject: [PATCH 12/17] polishing --- modules/allegroBidAdapter.js | 4 ++-- test/spec/modules/allegroBidAdapter_spec.js | 19 ++----------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 0c1d21bd784..e3be969c428 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -87,7 +87,7 @@ function convertExtensionFields(request) { * @param obj The object potentially containing `ext`. * @param {string} newKey The destination key name (e.g. '[com.google.doubleclick.site]'). */ -function moveExt(obj, newKey) { +export function moveExt(obj, newKey) { if (!obj || !obj.ext) { return; } @@ -290,4 +290,4 @@ export const spec = { }; -registerBidder(spec); \ No newline at end of file +registerBidder(spec); diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index e21c9e0c32b..b78d232b4fb 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { spec, moveExt, mapBidResponse } from 'modules/allegroBidAdapter.js'; +import { spec, moveExt } from 'modules/allegroBidAdapter.js'; import { config } from 'src/config.js'; import sinon from 'sinon'; import * as utils from 'src/utils.js'; @@ -383,19 +383,4 @@ describe('Allegro Bid Adapter', () => { expect(obj['[com.google.doubleclick.site]']).to.deep.equal({ custom: 'v' }); }); }); - - describe('mapBidResponse', () => { - it('returns the response unchanged when the base builder yields null', () => { - const result = mapBidResponse(() => null, {}, {}); - expect(result).to.equal(null); - }); - - it('maps DSP extension fields onto meta from the proto-json key', () => { - const bid = { '[com.allegro.dsp.dsp_bid]': { clientId: '42', productId: 'prod-1' } }; - const result = mapBidResponse(() => ({}), bid, {}); - expect(result.meta.advertiserId).to.equal('42'); - expect(result.meta.productId).to.equal('prod-1'); - }); - }); -}); - +v}); From 894cb7f8f2d4711c943c9d6daba3178b2b6b4138 Mon Sep 17 00:00:00 2001 From: PawResz Date: Thu, 6 Aug 2026 09:52:14 +0200 Subject: [PATCH 13/17] lint fix --- test/spec/modules/allegroBidAdapter_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index b78d232b4fb..615ced388b0 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -383,4 +383,4 @@ describe('Allegro Bid Adapter', () => { expect(obj['[com.google.doubleclick.site]']).to.deep.equal({ custom: 'v' }); }); }); -v}); +}); From 39ed152a7d81055680d0196a191808611daf9929 Mon Sep 17 00:00:00 2001 From: PawResz Date: Fri, 7 Aug 2026 12:09:56 +0200 Subject: [PATCH 14/17] cr --- modules/allegroBidAdapter.js | 4 ++-- test/spec/modules/allegroBidAdapter_spec.js | 21 +-------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index e3be969c428..4945230c7ca 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -8,7 +8,7 @@ import { config } from '../src/config.js'; import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; +const BIDDER_URL = 'http://localhost:9180/v1/rtb/prebid/bid'; const GVLID = 1493; /** @@ -87,7 +87,7 @@ function convertExtensionFields(request) { * @param obj The object potentially containing `ext`. * @param {string} newKey The destination key name (e.g. '[com.google.doubleclick.site]'). */ -export function moveExt(obj, newKey) { +function moveExt(obj, newKey) { if (!obj || !obj.ext) { return; } diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index 615ced388b0..985cf7bc58c 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { spec, moveExt } from 'modules/allegroBidAdapter.js'; +import { spec } from 'modules/allegroBidAdapter.js'; import { config } from 'src/config.js'; import sinon from 'sinon'; import * as utils from 'src/utils.js'; @@ -364,23 +364,4 @@ describe('Allegro Bid Adapter', () => { }); }); - describe('moveExt', () => { - it('does nothing when the object is missing', () => { - expect(() => moveExt(undefined, '[com.google.doubleclick.site]')).to.not.throw(); - }); - - it('does nothing when the object has no ext', () => { - const obj = { foo: 'bar' }; - moveExt(obj, '[com.google.doubleclick.site]'); - expect(obj).to.deep.equal({ foo: 'bar' }); - expect(obj['[com.google.doubleclick.site]']).to.equal(undefined); - }); - - it('moves ext into the bracketed key', () => { - const obj = { ext: { custom: 'v' } }; - moveExt(obj, '[com.google.doubleclick.site]'); - expect(obj.ext).to.equal(undefined); - expect(obj['[com.google.doubleclick.site]']).to.deep.equal({ custom: 'v' }); - }); - }); }); From 279a6972627e3007b141375a359fc9ca3a990848 Mon Sep 17 00:00:00 2001 From: PawResz Date: Fri, 7 Aug 2026 12:11:20 +0200 Subject: [PATCH 15/17] fix path --- modules/allegroBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/allegroBidAdapter.js b/modules/allegroBidAdapter.js index 4945230c7ca..9fc4fe461ec 100644 --- a/modules/allegroBidAdapter.js +++ b/modules/allegroBidAdapter.js @@ -8,7 +8,7 @@ import { config } from '../src/config.js'; import { triggerPixel, logInfo, logError } from '../src/utils.js'; const BIDDER_CODE = 'allegro'; -const BIDDER_URL = 'http://localhost:9180/v1/rtb/prebid/bid'; +const BIDDER_URL = 'https://prebid.rtb.allegro.pl/v1/rtb/prebid/bid'; const GVLID = 1493; /** From ee73d30738e9f01390cda8e5cb64acaa33af86a7 Mon Sep 17 00:00:00 2001 From: PawResz Date: Fri, 7 Aug 2026 12:14:10 +0200 Subject: [PATCH 16/17] rm tests --- test/spec/modules/allegroBidAdapter_spec.js | 79 +-------------------- 1 file changed, 1 insertion(+), 78 deletions(-) diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index 985cf7bc58c..a42245052c5 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -147,74 +147,9 @@ describe('Allegro Bid Adapter', () => { expect(imp.secure).to.equal(true); expect(req.data.test).to.equal(true); }); - - it('converts imp and imp.banner extension fields', () => { - sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const bidRequests = [buildBidRequest({ - ortb2Imp: { - ext: { impCustom: 'imp' }, - banner: { ext: { bannerCustom: 'ban' } } - } - })]; - const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests)); - const imp = req.data.imp[0]; - expect(imp.ext).to.equal(undefined); - expect(imp['[com.google.doubleclick.imp]'].impCustom).to.equal('imp'); - expect(imp.banner.ext).to.equal(undefined); - expect(imp.banner['[com.google.doubleclick.banner_ext]'].bannerCustom).to.equal('ban'); - }); - - it('converts app and device.geo extension fields', () => { - sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const bidRequests = [buildBidRequest({})]; - const ortb2 = { - app: { ext: { appCustom: 'app' } }, - device: { geo: { ext: { geoCustom: 'geo' } } } - }; - const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); - const data = req.data; - expect(data.app.ext).to.equal(undefined); - expect(data.app['[com.google.doubleclick.app]'].appCustom).to.equal('app'); - expect(data.device.geo.ext).to.equal(undefined); - expect(data.device.geo['[com.google.doubleclick.geo]'].geoCustom).to.equal('geo'); - }); - - it('keeps a valid supply chain on the request', () => { - sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const bidRequests = [buildBidRequest({})]; - const ortb2 = { source: { schain: { ver: '1.0', nodes: [{ asi: 'a.com', sid: '1', hp: 1 }] } } }; - const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); - expect(req.data.source.schain).to.exist; - expect(req.data.source.schain.nodes).to.have.lengthOf(1); - }); - - it('drops a supply chain whose nodes miss required fields', () => { - sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const bidRequests = [buildBidRequest({})]; - const ortb2 = { source: { schain: { nodes: [{ asi: 'a.com' }] } } }; - const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); - expect(req.data.source.schain).to.equal(undefined); - }); - - it('drops a supply chain that has no nodes array', () => { - sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const bidRequests = [buildBidRequest({})]; - const ortb2 = { source: { schain: { ver: '1.0' } } }; - const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); - expect(req.data.source.schain).to.equal(undefined); - }); - - it('drops a supply chain when node validation throws', () => { - sinon.stub(config, 'getConfig').callsFake((key) => undefined); - const errorStub = sinon.stub(utils, 'logError'); - const bidRequests = [buildBidRequest({})]; - const ortb2 = { source: { schain: { nodes: [null] } } }; - const req = spec.buildRequests(bidRequests, buildBidderRequest(bidRequests, ortb2)); - expect(req.data.source.schain).to.equal(undefined); - expect(errorStub.called).to.equal(true); - }); }); + describe('interpretResponse', () => { it('returns undefined for empty body', () => { const result = spec.interpretResponse({}, { data: {} }); @@ -351,17 +286,5 @@ describe('Allegro Bid Adapter', () => { const calledWith = pixelSpy.getCall(0).args[0]; expect(calledWith).to.equal(bid.burl); }); - - it('logs the winning bid when debug is enabled', () => { - const infoStub = sinon.stub(utils, 'logInfo'); - sinon.stub(config, 'getConfig').callsFake((key) => { - if (key === 'debug') return true; - return undefined; - }); - const bid = { adId: 'ad-1', cpm: 1.5 }; - spec.onBidWon(bid); - expect(infoStub.calledWith('bid won', bid)).to.equal(true); - }); }); - }); From edb87aefd694d8f8a7acc96f37d8f27621bbc738 Mon Sep 17 00:00:00 2001 From: PawResz Date: Fri, 7 Aug 2026 12:17:49 +0200 Subject: [PATCH 17/17] rm more --- test/spec/modules/allegroBidAdapter_spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/spec/modules/allegroBidAdapter_spec.js b/test/spec/modules/allegroBidAdapter_spec.js index a42245052c5..d75ffcae036 100644 --- a/test/spec/modules/allegroBidAdapter_spec.js +++ b/test/spec/modules/allegroBidAdapter_spec.js @@ -4,14 +4,13 @@ import { config } from 'src/config.js'; import sinon from 'sinon'; import * as utils from 'src/utils.js'; -function buildBidRequest({ bidId = 'bid1', adUnitCode = 'div-1', sizes = [[300, 250]], params = {}, mediaTypes, ortb2Imp } = {}) { +function buildBidRequest({ bidId = 'bid1', adUnitCode = 'div-1', sizes = [[300, 250]], params = {}, mediaTypes } = {}) { return { bidId, adUnitCode, bidder: 'allegro', params, mediaTypes: mediaTypes || { banner: { sizes } }, - ...(ortb2Imp ? { ortb2Imp } : {}), }; } @@ -149,7 +148,6 @@ describe('Allegro Bid Adapter', () => { }); }); - describe('interpretResponse', () => { it('returns undefined for empty body', () => { const result = spec.interpretResponse({}, { data: {} });