From 813bf0b02297d082c1d084b4e9cc11a7ec8486c2 Mon Sep 17 00:00:00 2001 From: Aparna Hegde Date: Wed, 28 Mar 2018 13:32:04 -0400 Subject: [PATCH 1/2] Adapter to infer creative ID from crid --- modules/33acrossBidAdapter.js | 6 +++- test/spec/modules/33acrossBidAdapter_spec.js | 32 +++++--------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index b496a66d081..4a375ec5dfc 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -15,7 +15,7 @@ function _createBidResponse(response) { height: response.seatbid[0].bid[0].h, ad: response.seatbid[0].bid[0].adm, ttl: response.seatbid[0].bid[0].ttl || 60, - creativeId: response.seatbid[0].bid[0].ext.rp.advid, + creativeId: response.seatbid[0].bid[0].crid, currency: response.cur, netRevenue: true } @@ -45,6 +45,10 @@ function _createServerRequest(bidRequest) { // Go ahead send the bidId in request to 33exchange so it's kept track of in the bid response and // therefore in ad targetting process ttxRequest.id = bidRequest.bidId; + // Finally, set the openRTB 'test' param if this is to be a test bid + if (params.test === 1) { + ttxRequest.test = 1; + } const options = { contentType: 'application/json', diff --git a/test/spec/modules/33acrossBidAdapter_spec.js b/test/spec/modules/33acrossBidAdapter_spec.js index edb9958ae66..b04731cbccf 100644 --- a/test/spec/modules/33acrossBidAdapter_spec.js +++ b/test/spec/modules/33acrossBidAdapter_spec.js @@ -227,14 +227,10 @@ describe('33acrossBidAdapter:', function () { bid: [{ id: '1', adm: '

I am an ad

', - ext: { - rp: { - advid: 1 - } - }, h: 250, w: 300, - price: 0.0938 + price: 0.0938, + crid: 1 }] } ] @@ -281,26 +277,18 @@ describe('33acrossBidAdapter:', function () { bid: [{ id: '1', adm: '

I am an ad

', - ext: { - rp: { - advid: 1 - } - }, h: 250, w: 300, - price: 0.0940 + price: 0.0940, + crid: 1 }, { id: '2', adm: '

I am an ad

', - ext: { - rp: { - advid: 2 - } - }, h: 250, w: 300, - price: 0.0938 + price: 0.0938, + crid: 2 } ] }, @@ -308,14 +296,10 @@ describe('33acrossBidAdapter:', function () { bid: [{ id: '3', adm: '

I am an ad

', - ext: { - rp: { - advid: 3 - } - }, h: 250, w: 300, - price: 0.0938 + price: 0.0938, + crid: 3 }] } ] From 1b0695dcd54a0ddb25580592d1a04c0a257f31fc Mon Sep 17 00:00:00 2001 From: Aparna Hegde Date: Wed, 28 Mar 2018 16:18:52 -0400 Subject: [PATCH 2/2] User syncing with html + sending cookies in header --- modules/33acrossBidAdapter.js | 4 ++-- test/spec/modules/33acrossBidAdapter_spec.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index 4a375ec5dfc..a1253580874 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -3,7 +3,7 @@ const utils = require('../src/utils'); const BIDDER_CODE = '33across'; const END_POINT = 'https://ssc.33across.com/api/v1/hb'; -const SYNC_ENDPOINT = 'https://de.tynt.com/deb/v2?m=xch'; +const SYNC_ENDPOINT = 'https://de.tynt.com/deb/v2?m=xch&rt=html'; // All this assumes that only one bid is ever returned by ttx function _createBidResponse(response) { @@ -52,7 +52,7 @@ function _createServerRequest(bidRequest) { const options = { contentType: 'application/json', - withCredentials: false + withCredentials: true }; if (bidRequest.params.customHeaders) { diff --git a/test/spec/modules/33acrossBidAdapter_spec.js b/test/spec/modules/33acrossBidAdapter_spec.js index b04731cbccf..cd9b7dfffcc 100644 --- a/test/spec/modules/33acrossBidAdapter_spec.js +++ b/test/spec/modules/33acrossBidAdapter_spec.js @@ -145,7 +145,7 @@ describe('33acrossBidAdapter:', function () { data: JSON.stringify(ttxRequest), options: { contentType: 'application/json', - withCredentials: false + withCredentials: true } } const builtServerRequests = buildRequests(this.bidRequests); @@ -198,7 +198,7 @@ describe('33acrossBidAdapter:', function () { data: JSON.stringify(ttxRequest), options: { contentType: 'application/json', - withCredentials: false, + withCredentials: true, customHeaders: { foo: 'bar' } @@ -230,7 +230,7 @@ describe('33acrossBidAdapter:', function () { h: 250, w: 300, price: 0.0938, - crid: 1 + crid: '23455' }] } ] @@ -244,7 +244,7 @@ describe('33acrossBidAdapter:', function () { height: 250, ad: '

I am an ad

', ttl: 60, - creativeId: 1, + creativeId: '23455', currency: 'USD', netRevenue: true } @@ -345,14 +345,14 @@ describe('33acrossBidAdapter:', function () { params: { site: { id: 'id1' }, productId: 'p1', - syncUrl: 'https://staging-de.tynt.com/deb/v2?m=xch' + syncUrl: 'https://foo.com/v2?m=xch' } }, { params: { site: { id: 'id2' }, productId: 'p1', - syncUrl: 'https://staging-de.tynt.com/deb/v2?m=xch' + syncUrl: 'https://foo.com/v2?m=xch' } } ]; @@ -360,22 +360,22 @@ describe('33acrossBidAdapter:', function () { this.syncs = [ { type: 'iframe', - url: 'https://de.tynt.com/deb/v2?m=xch&id=id1' + url: 'https://de.tynt.com/deb/v2?m=xch&rt=html&id=id1' }, { type: 'iframe', - url: 'https://de.tynt.com/deb/v2?m=xch&id=id2' + url: 'https://de.tynt.com/deb/v2?m=xch&rt=html&id=id2' }, ]; this.testSyncs = [ { type: 'iframe', - url: 'https://staging-de.tynt.com/deb/v2?m=xch&id=id1' + url: 'https://foo.com/v2?m=xch&id=id1' }, { type: 'iframe', - url: 'https://staging-de.tynt.com/deb/v2?m=xch&id=id2' + url: 'https://foo.com/v2?m=xch&id=id2' }, ]; });