From a442a622608f7678a9b32c61742d9f1d266e8025 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Thu, 15 Apr 2021 12:56:30 +0200 Subject: [PATCH 1/8] adomain support --- modules/ccxBidAdapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ccxBidAdapter.js b/modules/ccxBidAdapter.js index ee15d6bb3ec..71b933be0d4 100644 --- a/modules/ccxBidAdapter.js +++ b/modules/ccxBidAdapter.js @@ -117,7 +117,8 @@ function _buildResponse (bid, currency, ttl) { creativeId: bid.crid, netRevenue: false, ttl: ttl, - currency: currency + currency: currency, + advertiserDomains: bid.adomain || [] } if (bid.ext.type === 'video') { From a9e907e5cbd8ccaa5901a7090f9e1a3d42495674 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Thu, 15 Apr 2021 15:21:05 +0200 Subject: [PATCH 2/8] adomain support --- modules/ccxBidAdapter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ccxBidAdapter.js b/modules/ccxBidAdapter.js index 71b933be0d4..37b6fdc3e98 100644 --- a/modules/ccxBidAdapter.js +++ b/modules/ccxBidAdapter.js @@ -117,8 +117,12 @@ function _buildResponse (bid, currency, ttl) { creativeId: bid.crid, netRevenue: false, ttl: ttl, - currency: currency, - advertiserDomains: bid.adomain || [] + currency: currency + } + + resp.meta = {}; + if (bid.adomain && bid.adomain.length > 0) { + resp.meta.advertiserDomains = bid.adomain; } if (bid.ext.type === 'video') { From df2570755e295a314d3ed1b8f99dd7219d3acd37 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Wed, 21 Apr 2021 11:07:21 +0200 Subject: [PATCH 3/8] adomain support --- test/spec/modules/ccxBidAdapter_spec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/ccxBidAdapter_spec.js b/test/spec/modules/ccxBidAdapter_spec.js index f14612629b1..fa7c367e1f5 100644 --- a/test/spec/modules/ccxBidAdapter_spec.js +++ b/test/spec/modules/ccxBidAdapter_spec.js @@ -337,7 +337,10 @@ describe('ccxAdapter', function () { netRevenue: false, ttl: 5, currency: 'PLN', - ad: '' + ad: '', + meta: { + advertiserDomains: 'clickonometrics.com' + } }, { requestId: '2e56e1af51a5d8', @@ -366,7 +369,10 @@ describe('ccxAdapter', function () { netRevenue: false, ttl: 5, currency: 'PLN', - ad: '' + ad: '', + meta: { + advertiserDomains: 'clickonometrics.com' + } } ]; expect(spec.interpretResponse({body: response})).to.deep.have.same.members(bidResponses); From fb44d172ed05bd449d0a343223afc69760d39602 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Wed, 21 Apr 2021 11:15:52 +0200 Subject: [PATCH 4/8] adomain support --- test/spec/modules/ccxBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/ccxBidAdapter_spec.js b/test/spec/modules/ccxBidAdapter_spec.js index fa7c367e1f5..21c20df944c 100644 --- a/test/spec/modules/ccxBidAdapter_spec.js +++ b/test/spec/modules/ccxBidAdapter_spec.js @@ -339,7 +339,7 @@ describe('ccxAdapter', function () { currency: 'PLN', ad: '', meta: { - advertiserDomains: 'clickonometrics.com' + advertiserDomains: ['clickonometrics.com'] } }, { @@ -371,7 +371,7 @@ describe('ccxAdapter', function () { currency: 'PLN', ad: '', meta: { - advertiserDomains: 'clickonometrics.com' + advertiserDomains: ['clickonometrics.com'] } } ]; From a7ec99f4c9c9d483be1c19030a01fd1f06fa8aeb Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Wed, 21 Apr 2021 11:23:47 +0200 Subject: [PATCH 5/8] adomain support --- test/spec/modules/ccxBidAdapter_spec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/ccxBidAdapter_spec.js b/test/spec/modules/ccxBidAdapter_spec.js index 21c20df944c..ef86b391e39 100644 --- a/test/spec/modules/ccxBidAdapter_spec.js +++ b/test/spec/modules/ccxBidAdapter_spec.js @@ -351,7 +351,10 @@ describe('ccxAdapter', function () { netRevenue: false, ttl: 5, currency: 'PLN', - vastXml: '' + vastXml: '', + meta: { + advertiserDomains: ['clickonometrics.com'] + } } ]; expect(spec.interpretResponse({body: response})).to.deep.have.same.members(bidResponses); From 56a3410395b4466f8e12c37b4c97b075a9df9969 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Tue, 11 May 2021 13:43:31 +0200 Subject: [PATCH 6/8] video params --- modules/ccxBidAdapter.js | 12 +++--- test/spec/modules/ccxBidAdapter_spec.js | 54 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/modules/ccxBidAdapter.js b/modules/ccxBidAdapter.js index 37b6fdc3e98..2160e539040 100644 --- a/modules/ccxBidAdapter.js +++ b/modules/ccxBidAdapter.js @@ -94,12 +94,12 @@ function _buildBid (bid) { } } - placement.video.protocols = utils.deepAccess(bid, 'params.video.protocols') || SUPPORTED_VIDEO_PROTOCOLS - placement.video.mimes = utils.deepAccess(bid, 'params.video.mimes') || SUPPORTED_VIDEO_MIMES - placement.video.playbackmethod = utils.deepAccess(bid, 'params.video.playbackmethod') || SUPPORTED_VIDEO_PLAYBACK_METHODS - placement.video.skip = utils.deepAccess(bid, 'params.video.skip') || 0 - if (placement.video.skip === 1 && utils.deepAccess(bid, 'params.video.skipafter')) { - placement.video.skipafter = utils.deepAccess(bid, 'params.video.skipafter') + placement.video.protocols = utils.deepAccess(bid, 'mediaTypes.video.protocols') || utils.deepAccess(bid, 'params.video.protocols') || SUPPORTED_VIDEO_PROTOCOLS + placement.video.mimes = utils.deepAccess(bid, 'mediaTypes.video.mimes') || utils.deepAccess(bid, 'params.video.mimes') || SUPPORTED_VIDEO_MIMES + placement.video.playbackmethod = utils.deepAccess(bid, 'mediaTypes.video.playbackmethod') || utils.deepAccess(bid, 'params.video.playbackmethod') || SUPPORTED_VIDEO_PLAYBACK_METHODS + placement.video.skip = utils.deepAccess(bid, 'mediaTypes.video.skip') || utils.deepAccess(bid, 'params.video.skip') || 0 + if (placement.video.skip === 1 && (utils.deepAccess(bid, 'mediaTypes.video.skipafter') || utils.deepAccess(bid, 'params.video.skipafter'))) { + placement.video.skipafter = utils.deepAccess(bid, 'mediaTypes.video.skipafter') || utils.deepAccess(bid, 'params.video.skipafter') } } diff --git a/test/spec/modules/ccxBidAdapter_spec.js b/test/spec/modules/ccxBidAdapter_spec.js index ef86b391e39..d346a14d38a 100644 --- a/test/spec/modules/ccxBidAdapter_spec.js +++ b/test/spec/modules/ccxBidAdapter_spec.js @@ -434,4 +434,58 @@ describe('ccxAdapter', function () { expect(spec.getUserSyncs(syncOptions, [{body: response}])).to.be.empty; }); }); + describe('mediaTypesVideoParams', function () { + it('Valid video mediaTypes', function () { + let bids = [ + { + adUnitCode: 'video', + auctionId: '0b9de793-8eda-481e-a548-c187d58b28d9', + bidId: '3u94t90ut39tt3t', + bidder: 'ccx', + bidderRequestId: '23ur20r239r2r', + mediaTypes: { + video: { + playerSize: [[640, 480]], + protocols: [2, 3, 5, 6], + mimes: ['video/mp4', 'video/x-flv'], + playbackmethod: [1, 2, 3, 4], + skip: 1, + skipafter: 5 + } + }, + params: { + placementId: 608 + }, + sizes: [[640, 480]], + transactionId: 'aefddd38-cfa0-48ab-8bdd-325de4bab5f9' + } + ]; + + let imps = [ + { + video: { + w: 640, + h: 480, + protocols: [2, 3, 5, 6], + mimes: ['video/mp4', 'video/x-flv'], + playbackmethod: [1, 2, 3, 4], + skip: 1, + skipafter: 5 + }, + id: '3u94t90ut39tt3t', + secure: 1, + ext: { + pid: 608 + } + } + ]; + + let bidsClone = utils.deepClone(bids); + + let response = spec.buildRequests(bidsClone, {'bids': bidsClone}); + let data = JSON.parse(response.data); + + expect(data.imp).to.deep.have.same.members(imps); + }); + }); }); From ddc3b198c07e7960933342bbf025182ee85803a3 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Wed, 19 May 2021 15:54:56 +0200 Subject: [PATCH 7/8] docs changes --- modules/ccxBidAdapter.md | 58 +++++----------------------------------- 1 file changed, 6 insertions(+), 52 deletions(-) diff --git a/modules/ccxBidAdapter.md b/modules/ccxBidAdapter.md index 740457dd099..7d86507bccb 100644 --- a/modules/ccxBidAdapter.md +++ b/modules/ccxBidAdapter.md @@ -32,67 +32,21 @@ Module that connects to Clickonometrics's demand sources mediaTypes: { video: { playerSize: [1920, 1080] - + protocols: [2, 3, 5, 6], //default + mimes: ["video/mp4", "video/x-flv"], //default + playbackmethod: [1, 2, 3, 4], //default + skip: 1, //default 0 + skipafter: 5 //delete this key if skip = 0 } }, bids: [ { bidder: "ccx", params: { - placementId: 3287742, - //following options are not required, default values will be used. Uncomment if you want to use custom values - /*video: { - //check OpenRTB documentation for following options description - protocols: [2, 3, 5, 6], //default - mimes: ["video/mp4", "video/x-flv"], //default - playbackmethod: [1, 2, 3, 4], //default - skip: 1, //default 0 - skipafter: 5 //delete this key if skip = 0 - }*/ + placementId: 3287742 } } ] } ]; - -# Pre 1.0 Support - - var adUnits = [ - { - code: 'test-banner', - mediaType: 'banner', - sizes: [300, 250], - bids: [ - { - bidder: "ccx", - params: { - placementId: 3286844 - } - } - ] - }, - { - code: 'test-video', - mediaType: 'video', - sizes: [1920, 1080] - bids: [ - { - bidder: "ccx", - params: { - placementId: 3287742, - //following options are not required, default values will be used. Uncomment if you want to use custom values - /*video: { - //check OpenRTB documentation for following options description - protocols: [2, 3, 5, 6], //default - mimes: ["video/mp4", "video/x-flv"], //default - playbackmethod: [1, 2, 3, 4], //default - skip: 1, //default 0 - skipafter: 5 //delete this key if skip = 0 - }*/ - } - } - ] - } - - ]; \ No newline at end of file From 397bb0b6616efa6d210b0dc65099c705e5607ff8 Mon Sep 17 00:00:00 2001 From: "m.jaworski" Date: Thu, 3 Nov 2022 13:47:52 +0100 Subject: [PATCH 8/8] Clickonometrics adapter update --- modules/ccxBidAdapter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ccxBidAdapter.js b/modules/ccxBidAdapter.js index 7c6b0411023..331bace7928 100644 --- a/modules/ccxBidAdapter.js +++ b/modules/ccxBidAdapter.js @@ -8,6 +8,7 @@ const BID_URL = 'https://delivery.clickonometrics.pl/ortb/prebid/bid' const SUPPORTED_VIDEO_PROTOCOLS = [2, 3, 5, 6] const SUPPORTED_VIDEO_MIMES = ['video/mp4', 'video/x-flv'] const SUPPORTED_VIDEO_PLAYBACK_METHODS = [1, 2, 3, 4] +const GVLID = 773; function _getDeviceObj () { let device = {} @@ -19,8 +20,7 @@ function _getDeviceObj () { function _getSiteObj (bidderRequest) { let site = {} - // TODO: does the fallback to window.location make sense? - let url = bidderRequest?.refererInfo?.page || window.location.href + let url = bidderRequest?.refererInfo?.page if (url.length > 0) { url = url.split('?')[0] } @@ -140,6 +140,7 @@ function _buildResponse (bid, currency, ttl) { export const spec = { code: BIDDER_CODE, + gvlid: GVLID, supportedMediaTypes: ['banner', 'video'], isBidRequestValid: function (bid) {