diff --git a/modules/asoBidAdapter.js b/modules/asoBidAdapter.js index 9469bc6b00c..83b182e4ca5 100644 --- a/modules/asoBidAdapter.js +++ b/modules/asoBidAdapter.js @@ -4,6 +4,7 @@ import { deepSetValue, getDNT, inIframe, + isArray, isFn, logWarn, parseSizesInput, @@ -19,6 +20,7 @@ const BIDDER_CODE = 'aso'; const DEFAULT_SERVER_URL = 'https://srv.aso1.net'; const DEFAULT_SERVER_PATH = '/prebid/bidder'; const OUTSTREAM_RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js'; +const VERSION = '$prebid.version$_1.1'; const TTL = 300; export const spec = { @@ -59,7 +61,7 @@ export const spec = { serverRequests.push({ method: 'POST', - url: getEnpoint(bidRequest), + url: getEndpoint(bidRequest), data: payload, options: { withCredentials: true, @@ -272,11 +274,9 @@ function createVideoImp(bidRequest, videoParams) { return imp; } -function getEnpoint(bidRequest) { - const serverUrl = bidRequest.params.serverUrl || DEFAULT_SERVER_URL; - const serverPath = bidRequest.params.serverPath || DEFAULT_SERVER_PATH; - - return serverUrl + serverPath + '?zid=' + bidRequest.params.zone + '&pbjs=$prebid.version$'; +function getEndpoint(bidRequest) { + const serverUrl = bidRequest.params.server || DEFAULT_SERVER_URL; + return serverUrl + DEFAULT_SERVER_PATH + '?zid=' + bidRequest.params.zone + '&pbjs=' + VERSION; } function getConsentsIds(gdprConsent) { @@ -341,6 +341,11 @@ function createBasePayload(bidRequest, bidderRequest) { deepSetValue(payload, 'user.ext.eids', eids); } + const schainData = deepAccess(bidRequest, 'schain.nodes'); + if (isArray(schainData) && schainData.length > 0) { + deepSetValue(payload, 'source.ext.schain', bidRequest.schain); + } + return payload; } diff --git a/modules/asoBidAdapter.md b/modules/asoBidAdapter.md index 32f4ebf5cef..f187389c5b5 100644 --- a/modules/asoBidAdapter.md +++ b/modules/asoBidAdapter.md @@ -14,12 +14,11 @@ For more information, please visit [Adserver.Online](https://adserver.online). # Parameters -| Name | Scope | Description | Example | Type | -|---------------|----------|-------------------------|-----------|-----------| -| `zone` | required | Zone ID | `73815` | `Integer` | -| `attr` | optional | Custom targeting params | `{keywords: ["a", "b"]}` | `Object` | - - +| Name | Scope | Description | Example | Type | +|-----------|----------|-------------------------|------------------------|------------| +| `zone` | required | Zone ID | `73815` | `Integer` | +| `attr` | optional | Custom targeting params | `{foo: ["a", "b"]}` | `Object` | +| `server` | optional | Custom bidder endpoint | `https://endpoint.url` | `String` | # Test parameters for banner ```js diff --git a/test/spec/modules/asoBidAdapter_spec.js b/test/spec/modules/asoBidAdapter_spec.js index 5ac44cb1db4..88016d1902c 100644 --- a/test/spec/modules/asoBidAdapter_spec.js +++ b/test/spec/modules/asoBidAdapter_spec.js @@ -125,7 +125,7 @@ describe('Adserver.Online bidding adapter', function () { expect(parsedRequestUrl.pathname).to.equal('/prebid/bidder'); const query = parsedRequestUrl.search; - expect(query.pbjs).to.equal('$prebid.version$'); + expect(query.pbjs).to.contain('$prebid.version$'); expect(query.zid).to.equal('1'); expect(request.data).to.exist; @@ -162,7 +162,7 @@ describe('Adserver.Online bidding adapter', function () { expect(parsedRequestUrl.pathname).to.equal('/prebid/bidder'); const query = parsedRequestUrl.search; - expect(query.pbjs).to.equal('$prebid.version$'); + expect(query.pbjs).to.contain('$prebid.version$'); expect(query.zid).to.equal('2'); expect(request.data).to.not.be.empty;