From aed8f4f9193e275279d682c51c0deb69c0558a2b Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 11:39:34 +0100 Subject: [PATCH 1/9] Set time to live to 5 minutes Yieldlab auctions are valid for 5 minutes and not 10. A delivery of an adtag would lead to a new auction after the 5 minute expiration time. --- modules/yieldlabBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index 17c205359de..c2c747f58ef 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -5,7 +5,7 @@ import { VIDEO, BANNER } from 'src/mediaTypes' const ENDPOINT = 'https://ad.yieldlab.net' const BIDDER_CODE = 'yieldlab' -const BID_RESPONSE_TTL_SEC = 600 +const BID_RESPONSE_TTL_SEC = 300 const CURRENCY_CODE = 'EUR' export const spec = { From 85fef2ae726d137831ee423e18a1c7298725bbec Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 11:42:31 +0100 Subject: [PATCH 2/9] Use correct identifer for deals Did stands for demandId which is not a default and not a good identifer for deals. We should use pid (partnershipId) here as a unique identifer for a connection between supply and demand (including deals). --- modules/yieldlabBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index c2c747f58ef..9382614fb34 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -67,7 +67,7 @@ export const spec = { width: sizes[0], height: sizes[1], creativeId: '' + matchedBid.id, - dealId: matchedBid.did, + dealId: matchedBid.pid, currency: CURRENCY_CODE, netRevenue: true, ttl: BID_RESPONSE_TTL_SEC, From 05ffa4b69e05ad059d3af5cf4a9469937f5bd3b7 Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 11:45:12 +0100 Subject: [PATCH 3/9] Set revenue to gross-price --- modules/yieldlabBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index 9382614fb34..5ef0b3a3ccf 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -69,7 +69,7 @@ export const spec = { creativeId: '' + matchedBid.id, dealId: matchedBid.pid, currency: CURRENCY_CODE, - netRevenue: true, + netRevenue: false, ttl: BID_RESPONSE_TTL_SEC, referrer: '', ad: `` From c332432f0a71d7249b67637ac8fa811bb68548f2 Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 11:47:40 +0100 Subject: [PATCH 4/9] Add dynamic adsize for vast url The adsize of a video placement can have a lot of different adsizes and is never "1x1". --- modules/yieldlabBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index 5ef0b3a3ccf..b695a6f75f3 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -76,7 +76,7 @@ export const spec = { } if (isVideo(bidRequest)) { bidResponse.mediaType = VIDEO - bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.accountId}/1x1?ts=${timestamp}` + bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.accountId}/${sizes[0]}x${sizes[1]}?ts=${timestamp}` } bidResponses.push(bidResponse) From 78186b85a9e152ccbff897886520f790778d460e Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 11:49:37 +0100 Subject: [PATCH 5/9] Change maintainer to Yieldlab Platform Lunar and Yieldlab agree that the Adapter should be offically maintained by Yieldlab. --- modules/yieldlabBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/yieldlabBidAdapter.md b/modules/yieldlabBidAdapter.md index 0c9183aa4cd..eda0491c568 100644 --- a/modules/yieldlabBidAdapter.md +++ b/modules/yieldlabBidAdapter.md @@ -3,7 +3,7 @@ ``` Module Name: Yieldlab Bidder Adapter Module Type: Bidder Adapter -Maintainer: api@platform-lunar.com +Maintainer: solutions@yieldlab.de ``` # Description From 052041c291a3c6d0dc20c808829992229c4ce6cf Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 13:41:35 +0100 Subject: [PATCH 6/9] Use yieldlab test campaigns Campaigns set up in Yieldlab's test network to deliver all the time. --- modules/yieldlabBidAdapter.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/yieldlabBidAdapter.md b/modules/yieldlabBidAdapter.md index eda0491c568..a921a73d53b 100644 --- a/modules/yieldlabBidAdapter.md +++ b/modules/yieldlabBidAdapter.md @@ -14,19 +14,19 @@ Module that connects to Yieldlab's demand sources ``` var adUnits = [ { - code: "test1", - sizes: [[800, 250]] + code: "banner", + sizes: [[728, 90]], bids: [{ bidder: "yieldlab", params: { - placement: "4206978", - accountId: "2358365", - adSize: "800x250" + placement: "5220336", + accountId: "1381604", + adSize: "728x90" } }] }, { - code: "test2", - sizes: [[1, 1]], + code: "video", + sizes: [[640, 480]], mediaTypes: { video: { context: "instream" @@ -35,9 +35,9 @@ Module that connects to Yieldlab's demand sources bids: [{ bidder: "yieldlab", params: { - placementId: "4207034", - accountId: "2358365", - adSize: "1x1" + placementId: "5220339", + accountId: "1381604", + adSize: "640x480" } }] } From fa4d49f723dc563f27740c4d63796556bdb86f5c Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 13:47:15 +0100 Subject: [PATCH 7/9] Use yieldlab naming for params To make it less confusing for customers, we should use the actual naming used in our systems for the params used. --- modules/yieldlabBidAdapter.js | 16 ++++++++-------- modules/yieldlabBidAdapter.md | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index b695a6f75f3..dde5c70077e 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -13,7 +13,7 @@ export const spec = { supportedMediaTypes: [VIDEO, BANNER], isBidRequestValid: function (bid) { - if (bid && bid.params && bid.params.placementId && bid.params.adSize) { + if (bid && bid.params && bid.params.adslotId && bid.params.adSize) { return true } return false @@ -25,18 +25,18 @@ export const spec = { * @returns {{method: string, url: string}} */ buildRequests: function (validBidRequests) { - const placementIds = [] + const adslotIds = [] const timestamp = Date.now() utils._each(validBidRequests, function (bid) { - placementIds.push(bid.params.placementId) + adslotIds.push(bid.params.adslotId) }) - const placements = placementIds.join(',') + const adslots = adslotIds.join(',') return { method: 'GET', - url: `${ENDPOINT}/yp/${placements}?ts=${timestamp}&json=true`, + url: `${ENDPOINT}/yp/${adslots}?ts=${timestamp}&json=true`, validBidRequests: validBidRequests } }, @@ -56,7 +56,7 @@ export const spec = { } let matchedBid = find(serverResponse.body, function (bidResponse) { - return bidRequest.params.placementId == bidResponse.id + return bidRequest.params.adslotId == bidResponse.id }) if (matchedBid) { @@ -72,11 +72,11 @@ export const spec = { netRevenue: false, ttl: BID_RESPONSE_TTL_SEC, referrer: '', - ad: `` + ad: `` } if (isVideo(bidRequest)) { bidResponse.mediaType = VIDEO - bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.accountId}/${sizes[0]}x${sizes[1]}?ts=${timestamp}` + bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/${sizes[0]}x${sizes[1]}?ts=${timestamp}` } bidResponses.push(bidResponse) diff --git a/modules/yieldlabBidAdapter.md b/modules/yieldlabBidAdapter.md index a921a73d53b..0b11794ac8f 100644 --- a/modules/yieldlabBidAdapter.md +++ b/modules/yieldlabBidAdapter.md @@ -19,8 +19,8 @@ Module that connects to Yieldlab's demand sources bids: [{ bidder: "yieldlab", params: { - placement: "5220336", - accountId: "1381604", + adslotId: "5220336", + supplyId: "1381604", adSize: "728x90" } }] @@ -35,8 +35,8 @@ Module that connects to Yieldlab's demand sources bids: [{ bidder: "yieldlab", params: { - placementId: "5220339", - accountId: "1381604", + adslotId: "5220339", + supplyId: "1381604", adSize: "640x480" } }] From 146ac1c75dd66fb01e8636763b063664abd1f714 Mon Sep 17 00:00:00 2001 From: Mirko Feddern Date: Fri, 2 Mar 2018 16:07:11 +0100 Subject: [PATCH 8/9] Update test spec for yieldlab adapter --- test/spec/modules/yieldlabBidAdapter_spec.js | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/spec/modules/yieldlabBidAdapter_spec.js b/test/spec/modules/yieldlabBidAdapter_spec.js index 2a19763b10a..5787387a8e5 100644 --- a/test/spec/modules/yieldlabBidAdapter_spec.js +++ b/test/spec/modules/yieldlabBidAdapter_spec.js @@ -5,15 +5,15 @@ import { newBidder } from 'src/adapters/bidderFactory' const REQUEST = { 'bidder': 'yieldlab', 'params': { - 'placementId': '1111', - 'accountId': '2222', - 'adSize': '800x250' + 'adslotId': '1111', + 'supplyId': '2222', + 'adSize': '728x90' }, 'bidderRequestId': '143346cf0f1731', 'auctionId': '2e41f65424c87c', 'adUnitCode': 'adunit-code', 'bidId': '2d925f27f5079f', - 'sizes': [1, 1] + 'sizes': [728, 90] } const RESPONSE = { @@ -37,9 +37,9 @@ describe('yieldlabBidAdapter', () => { it('should return true when required params found', () => { const request = { 'params': { - 'placementId': '1111', - 'accountId': '2222', - 'adSize': '800x250' + 'adslotId': '1111', + 'supplyId': '2222', + 'adSize': '728x90' } } expect(spec.isBidRequestValid(request)).to.equal(true) @@ -78,15 +78,15 @@ describe('yieldlabBidAdapter', () => { expect(result[0].requestId).to.equal('2d925f27f5079f') expect(result[0].cpm).to.equal(0.01) - expect(result[0].width).to.equal(800) - expect(result[0].height).to.equal(250) + expect(result[0].width).to.equal(728) + expect(result[0].height).to.equal(90) expect(result[0].creativeId).to.equal('1111') expect(result[0].dealId).to.equal(undefined) expect(result[0].currency).to.equal('EUR') - expect(result[0].netRevenue).to.equal(true) - expect(result[0].ttl).to.equal(600) + expect(result[0].netRevenue).to.equal(false) + expect(result[0].ttl).to.equal(300) expect(result[0].referrer).to.equal('') - expect(result[0].ad).to.include('