From f055b6eac4b8fd81f1873e0de78aeb85198e8746 Mon Sep 17 00:00:00 2001 From: Justin Grimes Date: Thu, 1 Feb 2018 14:20:43 -0500 Subject: [PATCH 1/2] serverbid sync wip --- modules/serverbidBidAdapter.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/serverbidBidAdapter.js b/modules/serverbidBidAdapter.js index 2b1de9a9a89..abd19d27b94 100644 --- a/modules/serverbidBidAdapter.js +++ b/modules/serverbidBidAdapter.js @@ -24,6 +24,9 @@ const CONFIG = { } }; +let siteId = 0; +let bidder = 'serverbid'; + export const spec = { code: BIDDER_CODE, aliases: ['connectad', 'onefiftytwo', 'insticator', 'adsparc', 'automatad'], @@ -62,6 +65,10 @@ export const spec = { let ENDPOINT_URL; + // These variables are used in creating the user sync URL. + siteId = validBidRequests[0].params.siteId; + bidder = validBidRequests[0].params.bidder; + const data = Object.assign({ placements: [], time: Date.now(), @@ -140,7 +147,21 @@ export const spec = { }, getUserSyncs: function(syncOptions) { - return []; + if (syncOptions.iframeEnabled) { + if (bidder === 'connectad') { + return [{ + type: 'iframe', + url: '//cdn.connectad.io/connectmyusers.php' + }]; + } else { + return [{ + type: 'iframe', + url: '//s.zkcdn.net/ss/' + siteId + '.js' + }]; + } + } else { + utils.logWarn(bidder + ': Please enable iframe based user syncing.'); + } } }; @@ -185,6 +206,9 @@ sizeMap[429] = '486x60'; sizeMap[374] = '700x500'; sizeMap[934] = '300x1050'; sizeMap[1578] = '320x100'; +sizeMap[331] = '320x250'; +sizeMap[3301] = '320x267'; +sizeMap[2730] = '728x250'; function getSize(sizes) { const result = []; From 1903827f49f396dba049861120a356e9a9551778 Mon Sep 17 00:00:00 2001 From: Justin Grimes Date: Mon, 5 Feb 2018 12:58:44 -0500 Subject: [PATCH 2/2] Serverbid Bid Adapter: enable getUserSyncs, new ad sizes --- modules/serverbidBidAdapter.js | 2 +- test/spec/modules/serverbidBidAdapter_spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/serverbidBidAdapter.js b/modules/serverbidBidAdapter.js index abd19d27b94..24bb5aa6255 100644 --- a/modules/serverbidBidAdapter.js +++ b/modules/serverbidBidAdapter.js @@ -156,7 +156,7 @@ export const spec = { } else { return [{ type: 'iframe', - url: '//s.zkcdn.net/ss/' + siteId + '.js' + url: '//s.zkcdn.net/ss/' + siteId + '.html' }]; } } else { diff --git a/test/spec/modules/serverbidBidAdapter_spec.js b/test/spec/modules/serverbidBidAdapter_spec.js index fb31f925c6e..d3dc64ae6df 100644 --- a/test/spec/modules/serverbidBidAdapter_spec.js +++ b/test/spec/modules/serverbidBidAdapter_spec.js @@ -245,10 +245,10 @@ describe('Serverbid BidAdapter', () => { expect(opts).to.be.empty; }); - it('should always return empty array', () => { + it('should return a sync url if iframe syncs are enabled', () => { let opts = spec.getUserSyncs(syncOptions); - expect(opts).to.be.empty; + expect(opts.length).to.equal(1); }); }); });