From 69f6f6f3f560c7713c8dab8f256a25ee3883119c Mon Sep 17 00:00:00 2001 From: Catalin Ciocov Date: Wed, 12 Jun 2019 11:38:21 +0300 Subject: [PATCH 1/4] Add support for different publisher payment models. --- modules/inskinBidAdapter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/inskinBidAdapter.js b/modules/inskinBidAdapter.js index fbd87083b58..824baec1f06 100644 --- a/modules/inskinBidAdapter.js +++ b/modules/inskinBidAdapter.js @@ -116,7 +116,10 @@ export const spec = { if (serverResponse) { const decision = serverResponse.decisions && serverResponse.decisions[bidId]; - const price = decision && decision.pricing && decision.pricing.clearPrice; + const data = decision && decision.contents && decision.contents[0] && decision.contents[0].data; + const pubCPM = data && data.customData && data.customData.pubCPM; + const clearPrice = decision && decision.pricing && decision.pricing.clearPrice; + const price = pubCPM || clearPrice; if (decision && price) { bid.requestId = bidId; From ce7eb9fed8af7a82b5219eaa67896d59696c5c96 Mon Sep 17 00:00:00 2001 From: Catalin Ciocov Date: Wed, 12 Jun 2019 11:38:52 +0300 Subject: [PATCH 2/4] Add Inskin integration example. --- integrationExamples/gpt/inskin_example.html | 102 ++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 integrationExamples/gpt/inskin_example.html diff --git a/integrationExamples/gpt/inskin_example.html b/integrationExamples/gpt/inskin_example.html new file mode 100644 index 00000000000..197a5b1ffe1 --- /dev/null +++ b/integrationExamples/gpt/inskin_example.html @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + +

Prebid.js Test

+
Div-1
+
+ +
+ + From af1b90b5b225024d863de86dd0bd6887625d82df Mon Sep 17 00:00:00 2001 From: Catalin Ciocov Date: Wed, 3 Jul 2019 13:05:50 +0300 Subject: [PATCH 3/4] Append pubcpm to impression tracker. --- modules/inskinBidAdapter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/inskinBidAdapter.js b/modules/inskinBidAdapter.js index 824baec1f06..ae8eebcb7ae 100644 --- a/modules/inskinBidAdapter.js +++ b/modules/inskinBidAdapter.js @@ -122,6 +122,9 @@ export const spec = { const price = pubCPM || clearPrice; if (decision && price) { + decision.impressionUrl += ('&property:pubcpm=' + price); + bidObj.price = price; + bid.requestId = bidId; bid.cpm = price; bid.width = decision.width; @@ -152,6 +155,7 @@ export const spec = { const id = 'ism_tag_' + Math.floor((Math.random() * 10e16)); window[id] = { bidId: e.data.bidId, + bidPrice: bidsMap[e.data.bidId].price, serverResponse }; const script = document.createElement('script'); From a9d35cadac0127a75643a1a7d2bacf7670842256 Mon Sep 17 00:00:00 2001 From: Catalin Ciocov Date: Tue, 23 Jul 2019 08:14:52 +0300 Subject: [PATCH 4/4] Added unit tests for pubCMP vs clearPrice. --- test/spec/modules/inskinBidAdapter_spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/spec/modules/inskinBidAdapter_spec.js b/test/spec/modules/inskinBidAdapter_spec.js index 8a62a465a5b..896fe36d443 100644 --- a/test/spec/modules/inskinBidAdapter_spec.js +++ b/test/spec/modules/inskinBidAdapter_spec.js @@ -82,6 +82,9 @@ const RESPONSE = { 'type': 'html', 'body': '', 'data': { + 'customData': { + 'pubCPM': 1 + }, 'height': 90, 'width': 728, 'imageUrl': 'https://static.adzerk.net/Advertisers/b0ab77db8a7848c8b78931aed022a5ef.gif', @@ -241,6 +244,13 @@ describe('InSkin BidAdapter', function () { }); }); + it('cpm is correctly set', function () { + let bids = spec.interpretResponse(RESPONSE, REQUEST); + + expect(bids[0].cpm).to.equal(0.5); + expect(bids[1].cpm).to.equal(1); + }); + it('handles nobid responses', function () { let EMPTY_RESP = Object.assign({}, RESPONSE, {'body': {'decisions': null}}) let bids = spec.interpretResponse(EMPTY_RESP, REQUEST);