From 86546e9a51375bf6be11d28fef9bfde11f6a550c Mon Sep 17 00:00:00 2001 From: Will Chapin Date: Mon, 16 Sep 2019 13:31:01 -0400 Subject: [PATCH 01/18] Add IdentityLink support and fix UnifiedId. It appears we've been looking for UnifiedId userIds on the bidderRequest object, when they are found on bidRequests. This commit fixes that error, and adds support for IdentityLink. --- modules/tripleliftBidAdapter.js | 56 +++--- .../spec/modules/tripleliftBidAdapter_spec.js | 164 ++++++++++++++---- 2 files changed, 162 insertions(+), 58 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 2d6b2dce8de..5ed88384b11 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -17,7 +17,7 @@ export const tripleliftAdapterSpec = { buildRequests: function(bidRequests, bidderRequest) { let tlCall = STR_ENDPOINT; - let data = _buildPostBody(bidRequests, bidderRequest); + let data = _buildPostBody(bidRequests); tlCall = utils.tryAppendQueryString(tlCall, 'lib', 'prebid'); tlCall = utils.tryAppendQueryString(tlCall, 'v', '$prebid.version$'); @@ -78,7 +78,7 @@ export const tripleliftAdapterSpec = { } } -function _buildPostBody(bidRequests, bidderRequest) { +function _buildPostBody(bidRequests) { let data = {}; data.imp = bidRequests.map(function(bid, index) { return { @@ -91,7 +91,11 @@ function _buildPostBody(bidRequests, bidderRequest) { }; }); - let eids = handleConsortiaUserIds(bidderRequest); + let eids = [ + ...getUnifiedIdEids(bidRequests), + ...getIdentityLinkEids(bidRequests) + ]; + if (eids.length > 0) { data.user = { ext: {eids} @@ -101,6 +105,35 @@ function _buildPostBody(bidRequests, bidderRequest) { return data; } +function getUnifiedIdEids(bidRequests) { + return getEids(bidRequests, 'tdid', 'adserver.org', 'TDID'); +} + +function getIdentityLinkEids(bidRequests) { + return getEids(bidRequests, 'idl_env', 'liveramp.com', 'idl'); +} + +function getEids(bidRequests, type, source, rtiPartner) { + return bidRequests + .map(getUserId(type)) // bids -> userIds of a certain type + .filter((x) => !!x) // filter out null userIds + .map(formatEid(source, rtiPartner)); // userIds -> eid objects +} + +function getUserId(type) { + return (bid) => (bid && bid.userId && bid.userId[type]); +} + +function formatEid(source, rtiPartner) { + return (id) => ({ + source, + uids: [{ + id, + ext: { rtiPartner } + }] + }); +} + function _sizes(sizeArray) { let sizes = sizeArray.filter(_isValidSize); return sizes.map(function(size) { @@ -115,23 +148,6 @@ function _isValidSize(size) { return (size.length === 2 && typeof size[0] === 'number' && typeof size[1] === 'number'); } -function handleConsortiaUserIds(bidderRequest) { - let eids = []; - if (bidderRequest.userId && bidderRequest.userId.tdid) { - eids.push({ - source: 'adserver.org', - uids: [{ - id: bidderRequest.userId.tdid, - ext: { - rtiPartner: 'TDID' - } - }] - }); - } - - return eids; -} - function _buildResponseObject(bidderRequest, bid) { let bidResponse = {}; let width = bid.width || 1; diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 52a7be3020c..190f463f7a5 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -54,46 +54,49 @@ describe('triplelift adapter', function () { }); describe('buildRequests', function () { - let bidRequests = [ - { - bidder: 'triplelift', - params: { - inventoryCode: '12345', - floor: 1.0, - }, - adUnitCode: 'adunit-code', - sizes: [[300, 250], [300, 600], [1, 1, 1], ['flex']], - bidId: '30b31c1838de1e', - bidderRequestId: '22edbae2733bf6', - auctionId: '1d1a030790a475', - } - ]; + let bidRequests; + let bidderRequest; - let bidderRequest = { - bidderCode: 'triplelift', - auctionId: 'a7ebcd1d-66ff-4b5c-a82c-6a21a6ee5a18', - bidderRequestId: '5c55612f99bc11', - bids: [ + this.beforeEach(() => { + bidRequests = [ { - imp_id: 0, - cpm: 1.062, - width: 300, - height: 250, - ad: 'ad-markup', - iurl: 'https://s.adroll.com/a/IYR/N36/IYRN366MFVDITBAGNNT5U6.jpg' + bidder: 'triplelift', + params: { + inventoryCode: '12345', + floor: 1.0, + }, + adUnitCode: 'adunit-code', + sizes: [[300, 250], [300, 600], [1, 1, 1], ['flex']], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + userId: {}, } - ], - refererInfo: { - referer: 'http://examplereferer.com' - }, - gdprConsent: { - consentString: 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY', - gdprApplies: true - }, - userId: { - tdid: '6bca7f6b-a98a-46c0-be05-6020f7604598' - } - }; + ]; + + bidderRequest = { + bidderCode: 'triplelift', + auctionId: 'a7ebcd1d-66ff-4b5c-a82c-6a21a6ee5a18', + bidderRequestId: '5c55612f99bc11', + bids: [ + { + imp_id: 0, + cpm: 1.062, + width: 300, + height: 250, + ad: 'ad-markup', + iurl: 'https://s.adroll.com/a/IYR/N36/IYRN366MFVDITBAGNNT5U6.jpg' + } + ], + refererInfo: { + referer: 'http://examplereferer.com' + }, + gdprConsent: { + consentString: 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY', + gdprApplies: true + }, + }; + }); it('exists and is an object', function () { const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); @@ -116,10 +119,95 @@ describe('triplelift adapter', function () { }); it('should add tdid to the payload if included', function () { + const id = '6bca7f6b-a98a-46c0-be05-6020f7604598'; + bidRequests[0].userId.tdid = id; + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + const payload = request.data; + expect(payload).to.exist; + expect(payload.user).to.deep.equal({ext: {eids: [{source: 'adserver.org', uids: [{id, ext: {rtiPartner: 'TDID'}}]}]}}); + }); + + it('should add idl_env to the payload if included', function () { + const id = 'XY6104gr0njcH9UDIR7ysFFJcm2XNpqeJTYslleJ_cMlsFOfZI'; + bidRequests[0].userId.idl_env = id; + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + const payload = request.data; + expect(payload).to.exist; + expect(payload.user).to.deep.equal({ext: {eids: [{source: 'liveramp.com', uids: [{id, ext: {rtiPartner: 'idl'}}]}]}}); + }); + + it('should add both tdid and idl_env to the payload if both are included', function () { + const tdidId = '6bca7f6b-a98a-46c0-be05-6020f7604598'; + const idlEnvId = 'XY6104gr0njcH9UDIR7ysFFJcm2XNpqeJTYslleJ_cMlsFOfZI'; + bidRequests[0].userId.tdid = tdidId; + bidRequests[0].userId.idl_env = idlEnvId; + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); const payload = request.data; + expect(payload).to.exist; - expect(payload.user).to.deep.equal({ext: {eids: [{source: 'adserver.org', uids: [{id: '6bca7f6b-a98a-46c0-be05-6020f7604598', ext: {rtiPartner: 'TDID'}}]}]}}); + expect(payload.user).to.deep.equal({ + ext: { + eids: [ + { + source: 'adserver.org', + uids: [ + { + id: tdidId, + ext: { rtiPartner: 'TDID' } + } + ], + }, + { + source: 'liveramp.com', + uids: [ + { + id: idlEnvId, + ext: { rtiPartner: 'idl' } + } + ] + } + ] + } + }); + }); + + it('should add user ids from multiple bid requests', function () { + const tdidId = '6bca7f6b-a98a-46c0-be05-6020f7604598'; + const idlEnvId = 'XY6104gr0njcH9UDIR7ysFFJcm2XNpqeJTYslleJ_cMlsFOfZI'; + + const bidRequestsMultiple = [ + { ...bidRequests[0], userId: { tdid: tdidId } }, + { ...bidRequests[0], userId: { idl_env: idlEnvId } }, + ]; + + const request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest); + const payload = request.data; + + expect(payload.user).to.deep.equal({ + ext: { + eids: [ + { + source: 'adserver.org', + uids: [ + { + id: tdidId, + ext: { rtiPartner: 'TDID' } + } + ], + }, + { + source: 'liveramp.com', + uids: [ + { + id: idlEnvId, + ext: { rtiPartner: 'idl' } + } + ] + } + ] + } + }); }); it('should return a query string for TL call', function () { From a98d3a4e3ed51bcd61860b327c9b7bead400c429 Mon Sep 17 00:00:00 2001 From: Will Chapin Date: Mon, 16 Sep 2019 15:27:01 -0400 Subject: [PATCH 02/18] change maintainer email to group --- modules/tripleliftBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.md b/modules/tripleliftBidAdapter.md index c10ea3675d4..d5f88a2bece 100644 --- a/modules/tripleliftBidAdapter.md +++ b/modules/tripleliftBidAdapter.md @@ -3,7 +3,7 @@ ``` Module Name: Triplelift Bid Adapter Module Type: Bidder Adapter -Maintainer: csmith+s2s@triplelift.com +Maintainer: prebid@triplelift.com ``` # Description From 0f5ea8b1fa06f5b5c8b6738b47ab77e1eb2e0d9a Mon Sep 17 00:00:00 2001 From: colbertk <50499465+colbertk@users.noreply.github.com> Date: Thu, 24 Oct 2019 13:55:57 -0400 Subject: [PATCH 03/18] TripleLift: Sending schain (#1) * Sending schain * null -> undefined --- modules/tripleliftBidAdapter.js | 6 ++++ .../spec/modules/tripleliftBidAdapter_spec.js | 28 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 5ed88384b11..d49e4cde480 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -80,6 +80,7 @@ export const tripleliftAdapterSpec = { function _buildPostBody(bidRequests) { let data = {}; + let { schain } = bidRequests[0]; data.imp = bidRequests.map(function(bid, index) { return { id: index, @@ -102,6 +103,11 @@ function _buildPostBody(bidRequests) { }; } + if (schain) { + data.ext = { + schain + } + } return data; } diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 190f463f7a5..12a2f66dde2 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -56,6 +56,20 @@ describe('triplelift adapter', function () { describe('buildRequests', function () { let bidRequests; let bidderRequest; + const schain = { + validation: 'strict', + config: { + ver: '1.0', + complete: 1, + nodes: [ + { + asi: 'indirectseller.com', + sid: '00001', + hp: 1, + } + ] + } + }; this.beforeEach(() => { bidRequests = [ @@ -71,6 +85,7 @@ describe('triplelift adapter', function () { bidderRequestId: '22edbae2733bf6', auctionId: '1d1a030790a475', userId: {}, + schain, } ]; @@ -220,6 +235,17 @@ describe('triplelift adapter', function () { expect(url).to.match(new RegExp('(?:' + prebid.version + ')')) expect(url).to.match(/(?:referrer)/); }); + it('should return schain when present', function() { + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + const { data: payload } = request; + expect(payload.ext.schain).to.deep.equal(schain); + }); + it('should not create root level ext when schain is not present', function() { + bidRequests[0].schain = undefined; + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + const { data: payload } = request; + expect(payload.ext).to.deep.equal(undefined); + }); }); describe('interpretResponse', function () { @@ -280,7 +306,7 @@ describe('triplelift adapter', function () { expect(Object.keys(result[0])).to.have.members(Object.keys(expectedResponse[0])); }); - it('should return multile responses to support SRA', function () { + it('should return multiple responses to support SRA', function () { let response = { body: { bids: [ From 44993e15dce9a79ebda9e8a9e9f51bbd21dfa805 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Mon, 25 Nov 2019 14:11:58 -0500 Subject: [PATCH 04/18] Hardcode sync endpoint protocol --- modules/tripleliftBidAdapter.js | 2 +- .../spec/modules/tripleliftBidAdapter_spec.js | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index d49e4cde480..1f045367669 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -63,7 +63,7 @@ export const tripleliftAdapterSpec = { }, getUserSyncs: function(syncOptions) { - let ibCall = '//ib.3lift.com/sync?'; + let ibCall = 'https://ib.3lift.com/sync?'; if (consentString !== null) { ibCall = utils.tryAppendQueryString(ibCall, 'gdpr', gdprApplies); ibCall = utils.tryAppendQueryString(ibCall, 'cmp_cs', consentString); diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 12a2f66dde2..afa427ef7ae 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -5,6 +5,7 @@ import { deepClone } from 'src/utils'; import prebid from '../../../package.json'; const ENDPOINT = 'https://tlx.3lift.com/header/auction?'; +const GDPR_CONSENT_STR = 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY'; describe('triplelift adapter', function () { const adapter = newBidder(tripleliftAdapterSpec); @@ -107,7 +108,7 @@ describe('triplelift adapter', function () { referer: 'http://examplereferer.com' }, gdprConsent: { - consentString: 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY', + consentString: GDPR_CONSENT_STR, gdprApplies: true }, }; @@ -281,7 +282,7 @@ describe('triplelift adapter', function () { referer: 'http://examplereferer.com' }, gdprConsent: { - consentString: 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY', + consentString: GDPR_CONSENT_STR, gdprApplies: true } }; @@ -355,7 +356,7 @@ describe('triplelift adapter', function () { referer: 'http://examplereferer.com' }, gdprConsent: { - consentString: 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY', + consentString: GDPR_CONSENT_STR, gdprApplies: true } }; @@ -363,4 +364,21 @@ describe('triplelift adapter', function () { expect(result).to.have.length(2); }); }); + + describe('getUserSyncs', function() { + let expectedSyncUrl = 'https://ib.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; + + it('returns undefined when syncing is not enabled', function() { + expect(tripleliftAdapterSpec.getUserSyncs({})).to.equal(undefined); + }); + + it('returns iframe user sync pixel when iframe syncing is enabled', function() { + let syncOptions = { + iframeEnabled: true + }; + let result = tripleliftAdapterSpec.getUserSyncs(syncOptions); + expect(result[0].type).to.equal('iframe'); + expect(result[0].url).to.equal(expectedSyncUrl); + }); + }); }); From b0adb54ad8beab0014b7e427d94a8f34a1b09af5 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Mon, 25 Nov 2019 14:28:41 -0500 Subject: [PATCH 05/18] Switch to EB2 sync endpoint --- modules/tripleliftBidAdapter.js | 2 +- test/spec/modules/tripleliftBidAdapter_spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 1f045367669..071f12046de 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -63,7 +63,7 @@ export const tripleliftAdapterSpec = { }, getUserSyncs: function(syncOptions) { - let ibCall = 'https://ib.3lift.com/sync?'; + let ibCall = 'https://eb2.3lift.com/sync?'; if (consentString !== null) { ibCall = utils.tryAppendQueryString(ibCall, 'gdpr', gdprApplies); ibCall = utils.tryAppendQueryString(ibCall, 'cmp_cs', consentString); diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index afa427ef7ae..0179b211517 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -366,7 +366,7 @@ describe('triplelift adapter', function () { }); describe('getUserSyncs', function() { - let expectedSyncUrl = 'https://ib.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; + let expectedSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; it('returns undefined when syncing is not enabled', function() { expect(tripleliftAdapterSpec.getUserSyncs({})).to.equal(undefined); From 0c6c2952dca494cc3bb9bee35e10d6df26e4d503 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Mon, 25 Nov 2019 17:01:32 -0500 Subject: [PATCH 06/18] Add support for image based user syncing --- modules/tripleliftBidAdapter.js | 25 ++++++++++++++----- .../spec/modules/tripleliftBidAdapter_spec.js | 24 ++++++++++++++++-- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 071f12046de..1ebaaa1c440 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -63,21 +63,34 @@ export const tripleliftAdapterSpec = { }, getUserSyncs: function(syncOptions) { + let syncType = _getSyncType(syncOptions); + if (!syncType) return; + let ibCall = 'https://eb2.3lift.com/sync?'; + + if (syncType === 'image') { + ibCall = utils.tryAppendQueryString(ibCall, 'px', 1); + ibCall = utils.tryAppendQueryString(ibCall, 'src', 'prebid'); + } + if (consentString !== null) { ibCall = utils.tryAppendQueryString(ibCall, 'gdpr', gdprApplies); ibCall = utils.tryAppendQueryString(ibCall, 'cmp_cs', consentString); } - if (syncOptions.iframeEnabled) { - return [{ - type: 'iframe', - url: ibCall - }]; - } + return [{ + type: syncType, + url: ibCall + }]; } } +function _getSyncType(syncOptions) { + if (!syncOptions) return; + if (syncOptions.iframeEnabled) return 'iframe'; + if (syncOptions.pixelEnabled) return 'image'; +} + function _buildPostBody(bidRequests) { let data = {}; let { schain } = bidRequests[0]; diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 0179b211517..aa312c4621e 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -366,7 +366,8 @@ describe('triplelift adapter', function () { }); describe('getUserSyncs', function() { - let expectedSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; + let expectedIframeSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; + let expectedImageSyncUrl = 'https://eb2.3lift.com/sync?px=1&src=prebid&gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; it('returns undefined when syncing is not enabled', function() { expect(tripleliftAdapterSpec.getUserSyncs({})).to.equal(undefined); @@ -378,7 +379,26 @@ describe('triplelift adapter', function () { }; let result = tripleliftAdapterSpec.getUserSyncs(syncOptions); expect(result[0].type).to.equal('iframe'); - expect(result[0].url).to.equal(expectedSyncUrl); + expect(result[0].url).to.equal(expectedIframeSyncUrl); + }); + + it('returns image user sync pixel when iframe syncing is disabled', function() { + let syncOptions = { + pixelEnabled: true + }; + let result = tripleliftAdapterSpec.getUserSyncs(syncOptions); + expect(result[0].type).to.equal('image') + expect(result[0].url).to.equal(expectedImageSyncUrl); + }); + + it('returns iframe user sync pixel when both options are enabled', function() { + let syncOptions = { + pixelEnabled: true, + iframeEnabled: true + }; + let result = tripleliftAdapterSpec.getUserSyncs(syncOptions); + expect(result[0].type).to.equal('iframe'); + expect(result[0].url).to.equal(expectedIframeSyncUrl); }); }); }); From 3f55f3239a9b83f139f9a20bd23c92db119d0c02 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 26 Nov 2019 17:11:43 -0500 Subject: [PATCH 07/18] Rename endpoint variable --- modules/tripleliftBidAdapter.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 1ebaaa1c440..1550a9e3463 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -66,21 +66,21 @@ export const tripleliftAdapterSpec = { let syncType = _getSyncType(syncOptions); if (!syncType) return; - let ibCall = 'https://eb2.3lift.com/sync?'; + let syncEndpoint = 'https://eb2.3lift.com/sync?'; if (syncType === 'image') { - ibCall = utils.tryAppendQueryString(ibCall, 'px', 1); - ibCall = utils.tryAppendQueryString(ibCall, 'src', 'prebid'); + syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'px', 1); + syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'src', 'prebid'); } if (consentString !== null) { - ibCall = utils.tryAppendQueryString(ibCall, 'gdpr', gdprApplies); - ibCall = utils.tryAppendQueryString(ibCall, 'cmp_cs', consentString); + syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'gdpr', gdprApplies); + syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString); } return [{ type: syncType, - url: ibCall + url: syncEndpoint }]; } } From 280404f4609883a08cda3cd5fe05915b0c0a38f3 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 26 Nov 2019 17:14:15 -0500 Subject: [PATCH 08/18] Add assertion --- test/spec/modules/tripleliftBidAdapter_spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index aa312c4621e..aee4c4d2586 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -371,6 +371,7 @@ describe('triplelift adapter', function () { it('returns undefined when syncing is not enabled', function() { expect(tripleliftAdapterSpec.getUserSyncs({})).to.equal(undefined); + expect(tripleliftAdapterSpec.getUserSyncs()).to.equal(undefined); }); it('returns iframe user sync pixel when iframe syncing is enabled', function() { From cad32b7a083670fecb366c4399858818757cbfb6 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 17 Dec 2019 16:05:55 -0500 Subject: [PATCH 09/18] Add CCPA query param --- modules/tripleliftBidAdapter.js | 10 +++++++++- test/spec/modules/tripleliftBidAdapter_spec.js | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 1550a9e3463..30f1f147364 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -42,6 +42,10 @@ export const tripleliftAdapterSpec = { } } + if (bidderRequest && bidderRequest.uspConsent) { + tlCall = utils.tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent); + } + if (tlCall.lastIndexOf('&') === tlCall.length - 1) { tlCall = tlCall.substring(0, tlCall.length - 1); } @@ -62,7 +66,7 @@ export const tripleliftAdapterSpec = { }); }, - getUserSyncs: function(syncOptions) { + getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) { let syncType = _getSyncType(syncOptions); if (!syncType) return; @@ -78,6 +82,10 @@ export const tripleliftAdapterSpec = { syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString); } + if (typeof usPrivacy === 'string' && usPrivacy.length > 0) { + syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'us_privacy', usPrivacy); + } + return [{ type: syncType, url: syncEndpoint diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 76c549c98ab..17dd64b8deb 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -236,6 +236,12 @@ describe('triplelift adapter', function () { expect(url).to.match(new RegExp('(?:' + prebid.version + ')')) expect(url).to.match(/(?:referrer)/); }); + it('should return us_privacy param when CCPA info is available', function() { + bidderRequest.uspConsent = '1YYY'; + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + const url = request.url; + expect(url).to.match(/(\?|&)us_privacy=1YYY/); + }); it('should return schain when present', function() { const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); const { data: payload } = request; @@ -401,5 +407,12 @@ describe('triplelift adapter', function () { expect(result[0].type).to.equal('iframe'); expect(result[0].url).to.equal(expectedIframeSyncUrl); }); + it('sends us_privacy param when info is available', function() { + let syncOptions = { + iframeEnabled: true + }; + let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY'); + expect(result[0].url).to.match(/(\?|&)us_privacy=1YYY/); + }); }); }); From 941e262eda0398c7a26893ac3e7261cb6979ea9d Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 17 Dec 2019 18:13:22 -0500 Subject: [PATCH 10/18] Simplify check for usPrivacy argument --- modules/tripleliftBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 30f1f147364..7120929059d 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -82,7 +82,7 @@ export const tripleliftAdapterSpec = { syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString); } - if (typeof usPrivacy === 'string' && usPrivacy.length > 0) { + if (usPrivacy) { syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'us_privacy', usPrivacy); } From 176460c264dba694ff1bc69ccc1679e2b7856d1c Mon Sep 17 00:00:00 2001 From: Kevin Zhou Date: Fri, 4 Sep 2020 12:33:05 -0400 Subject: [PATCH 11/18] put advertiser name in the bid.meta field if it exists --- modules/tripleliftBidAdapter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 967fa9fe596..9fe1bbfa1c4 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -235,13 +235,18 @@ function _buildResponseObject(bidderRequest, bid) { dealId: dealId, currency: 'USD', ttl: 300, - tl_source: bid.tl_source + tl_source: bid.tl_source, + meta: {} }; if (breq.mediaTypes.video) { bidResponse.vastXml = bid.ad; bidResponse.mediaType = 'video'; }; + + if (bid.advertiser_name) { + bidResponse.meta.advertiserName = bid.advertiser_name; + } }; return bidResponse; } From 61ebc4bdd1ef0b6d9a7b2a27c9193e26671386a7 Mon Sep 17 00:00:00 2001 From: Kevin Zhou Date: Fri, 4 Sep 2020 12:33:48 -0400 Subject: [PATCH 12/18] update unit tests with meta.advertiserName field --- test/spec/modules/tripleliftBidAdapter_spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 218b504eb5e..5ab3bd45977 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -399,6 +399,7 @@ describe('triplelift adapter', function () { ad: 'ad-markup', iurl: 'https://s.adroll.com/a/IYR/N36/IYRN366MFVDITBAGNNT5U6.jpg', tl_source: 'tlx', + advertiser_name: 'fake advertiser name' }, { imp_id: 1, @@ -472,6 +473,7 @@ describe('triplelift adapter', function () { currency: 'USD', ttl: 33, tl_source: 'tlx', + meta: {} }, { requestId: '30b31c1838de1e', @@ -487,6 +489,7 @@ describe('triplelift adapter', function () { tl_source: 'hdx', mediaType: 'video', vastXml: 'The Trade Desk', + meta: {} } ]; let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest}); @@ -499,6 +502,12 @@ describe('triplelift adapter', function () { let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest}); expect(result).to.have.length(2); }); + + it('should include the advertiser name in the meta field if available', function () { + let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest}); + expect(result[0].meta.advertiserName).to.equal('fake advertiser name') + expect(result[1].meta).to.not.have.key('advertiserName'); + }); }); describe('getUserSyncs', function() { From f0ba084bff2028fe095430a1691ae91d21dfd3d3 Mon Sep 17 00:00:00 2001 From: colbertk <50499465+colbertk@users.noreply.github.com> Date: Thu, 10 Sep 2020 13:09:18 -0400 Subject: [PATCH 13/18] Triplelift: FPD key value pair support (#5) * Triplelift: Add support for global fpd * don't filter fpd --- modules/tripleliftBidAdapter.js | 42 +++++++++++++++++-- .../spec/modules/tripleliftBidAdapter_spec.js | 31 ++++++++++++++ 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 9fe1bbfa1c4..0c6cbb9b8cf 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -107,6 +107,8 @@ function _getSyncType(syncOptions) { function _buildPostBody(bidRequests) { let data = {}; let { schain } = bidRequests[0]; + const globalFpd = _getGlobalFpd(); + data.imp = bidRequests.map(function(bidRequest, index) { let imp = { id: index, @@ -133,10 +135,10 @@ function _buildPostBody(bidRequests) { }; } - if (schain) { - data.ext = { - schain - } + let ext = _getExt(schain, globalFpd); + + if (!utils.isEmpty(ext)) { + data.ext = ext; } return data; } @@ -168,6 +170,38 @@ function _getFloor (bid) { return floor !== null ? floor : bid.params.floor; } +function _getGlobalFpd() { + let fpd = {}; + const fpdContext = Object.assign({}, config.getConfig('fpd.context')); + const fpdUser = Object.assign({}, config.getConfig('fpd.user')); + + _addEntries(fpd, fpdContext); + _addEntries(fpd, fpdUser); + + return fpd; +} + +function _addEntries(target, source) { + if (!utils.isEmpty(source)) { + Object.keys(source).forEach(key => { + if (source[key] != null) { + target[key] = source[key]; + } + }); + } +} + +function _getExt(schain, fpd) { + let ext = {}; + if (!utils.isEmpty(schain)) { + ext.schain = { ...schain }; + } + if (!utils.isEmpty(fpd)) { + ext.fpd = { ...fpd }; + } + return ext; +} + function getUnifiedIdEids(bidRequests) { return getEids(bidRequests, 'tdid', 'adserver.org', 'TDID'); } diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 5ab3bd45977..08c676dafa3 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -4,6 +4,7 @@ import { newBidder } from 'src/adapters/bidderFactory.js'; import { deepClone } from 'src/utils.js'; import { config } from 'src/config.js'; import prebid from '../../../package.json'; +import * as utils from 'src/utils.js'; const ENDPOINT = 'https://tlx.3lift.com/header/auction?'; const GDPR_CONSENT_STR = 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7Vf7nnG072lPVA9LTOQ6gEaY'; @@ -11,6 +12,7 @@ const GDPR_CONSENT_STR = 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7V describe('triplelift adapter', function () { const adapter = newBidder(tripleliftAdapterSpec); let bid, instreamBid; + let sandbox; this.beforeEach(() => { bid = { @@ -194,6 +196,10 @@ describe('triplelift adapter', function () { gdprApplies: true }, }; + sandbox = sinon.sandbox.create(); + }); + afterEach(() => { + sandbox.restore(); }); it('exists and is an object', function () { @@ -383,6 +389,31 @@ describe('triplelift adapter', function () { const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); expect(request.data.imp[0].floor).to.equal(1.99); }); + it('should send fpd on root level ext if kvps are available', function() { + const sens = null; + const category = ['news', 'weather', 'hurricane']; + const pmp_elig = 'true'; + const fpd = { + context: { + pmp_elig, + category, + }, + user: { + sens, + } + } + sandbox.stub(config, 'getConfig').callsFake(key => { + const config = { + fpd + }; + return utils.deepAccess(config, key); + }); + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + const { data: payload } = request; + expect(payload.ext.fpd).to.not.haveOwnProperty('sens'); + expect(payload.ext.fpd).to.haveOwnProperty('category'); + expect(payload.ext.fpd).to.haveOwnProperty('pmp_elig'); + }); }); describe('interpretResponse', function () { From 373b4b4d9246420c3b6b22c025d18db721264988 Mon Sep 17 00:00:00 2001 From: colbertk Date: Thu, 10 Sep 2020 14:45:03 -0400 Subject: [PATCH 14/18] adds coppa support back in --- modules/tripleliftBidAdapter.js | 4 ++++ test/spec/modules/tripleliftBidAdapter_spec.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 0c6cbb9b8cf..b003de7785f 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -51,6 +51,10 @@ export const tripleliftAdapterSpec = { tlCall = utils.tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent); } + if (config.getConfig('coppa') === true) { + tlCall = utils.tryAppendQueryString(tlCall, 'coppa', true); + } + if (tlCall.lastIndexOf('&') === tlCall.length - 1) { tlCall = tlCall.substring(0, tlCall.length - 1); } diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 08c676dafa3..797b3fab0c1 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -369,6 +369,20 @@ describe('triplelift adapter', function () { const url = request.url; expect(url).to.match(/(\?|&)us_privacy=1YYY/); }); + it('should return coppa param when COPPA config is set to true', function() { + sinon.stub(config, 'getConfig').withArgs('coppa').returns(true); + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + config.getConfig.restore(); + const url = request.url; + expect(url).to.match(/(\?|&)coppa=true/); + }); + it('should not return coppa param when COPPA config is set to false', function() { + sinon.stub(config, 'getConfig').withArgs('coppa').returns(false); + const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); + config.getConfig.restore(); + const url = request.url; + expect(url).not.to.match(/(\?|&)coppa=/); + }); it('should return schain when present', function() { const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); const { data: payload } = request; From feb4f6273b11c1a59f4bdacfab0dd29b65e0bc9d Mon Sep 17 00:00:00 2001 From: Sy Dao Date: Mon, 26 Oct 2020 15:02:38 -0700 Subject: [PATCH 15/18] add gvlid, update validation method, add unit tests --- modules/tripleliftBidAdapter.js | 8 +- .../spec/modules/tripleliftBidAdapter_spec.js | 174 +++++++++++++++++- 2 files changed, 172 insertions(+), 10 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 77a313a0f55..04506e49758 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -3,20 +3,17 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; +const GVLID = 28; const BIDDER_CODE = 'triplelift'; const STR_ENDPOINT = 'https://tlx.3lift.com/header/auction?'; let gdprApplies = true; let consentString = null; export const tripleliftAdapterSpec = { - + gvlid: GVLID, code: BIDDER_CODE, supportedMediaTypes: [BANNER, VIDEO], isBidRequestValid: function (bid) { - if (bid.mediaTypes.video) { - let video = _getORTBVideo(bid); - if (!video.w || !video.h) return false; - } return typeof bid.params.inventoryCode !== 'undefined'; }, @@ -295,6 +292,7 @@ function _buildResponseObject(bidderRequest, bid) { if (bid.advertiser_name) { bidResponse.meta.advertiserName = bid.advertiser_name; + bidResponse.meta.advertiserDomains = [bid.advertiser_name]; } }; return bidResponse; diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 96cab3d837c..e2f4841feef 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -83,15 +83,21 @@ describe('triplelift adapter', function () { expect(tripleliftAdapterSpec.isBidRequestValid(instreamBid)).to.equal(true); }); + it('should return true when required params found - instream - 2', function () { + delete instreamBid.mediaTypes.playerSize; + delete instreamBid.params.video.w; + delete instreamBid.params.video.h; + // the only required param is inventoryCode + expect(tripleliftAdapterSpec.isBidRequestValid(instreamBid)).to.equal(true); + }); + it('should return false when required params are not passed', function () { delete bid.params.inventoryCode; expect(tripleliftAdapterSpec.isBidRequestValid(bid)).to.equal(false); }); it('should return false when required params are not passed - instream', function () { - delete instreamBid.mediaTypes.playerSize; - delete instreamBid.params.video.w; - delete instreamBid.params.video.h; + delete instreamBid.params.inventoryCode; expect(tripleliftAdapterSpec.isBidRequestValid(instreamBid)).to.equal(false); }); }); @@ -165,6 +171,138 @@ describe('triplelift adapter', function () { userId: {}, schain, }, + // banner and outstream video + { + bidder: 'triplelift', + params: { + inventoryCode: 'outstream_test', + floor: 1.0, + video: { + mimes: ['video/mp4'], + maxduration: 30, + minduration: 6, + w: 640, + h: 480 + } + }, + mediaTypes: { + video: { + context: 'outstream', + playerSize: [640, 480] + }, + banner: { + sizes: [ + [970, 250], + [1, 1] + ] + } + }, + adUnitCode: 'adunit-code-instream', + sizes: [[300, 250], [300, 600], [1, 1, 1], ['flex']], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + userId: {}, + schain, + }, + // banner and incomplete video + { + bidder: 'triplelift', + params: { + inventoryCode: 'outstream_test', + floor: 1.0, + video: { + mimes: ['video/mp4'], + maxduration: 30, + minduration: 6, + w: 640, + h: 480 + } + }, + mediaTypes: { + video: { + + }, + banner: { + sizes: [ + [970, 250], + [1, 1] + ] + } + }, + adUnitCode: 'adunit-code-instream', + sizes: [[300, 250], [300, 600], [1, 1, 1], ['flex']], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + userId: {}, + schain, + }, + // incomplete banner and incomplete video + { + bidder: 'triplelift', + params: { + inventoryCode: 'outstream_test', + floor: 1.0, + video: { + mimes: ['video/mp4'], + maxduration: 30, + minduration: 6, + w: 640, + h: 480 + } + }, + mediaTypes: { + video: { + + }, + banner: { + + } + }, + adUnitCode: 'adunit-code-instream', + sizes: [[300, 250], [300, 600], [1, 1, 1], ['flex']], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + userId: {}, + schain, + }, + // banner and instream video + { + bidder: 'triplelift', + params: { + inventoryCode: 'outstream_test', + floor: 1.0, + video: { + mimes: ['video/mp4'], + maxduration: 30, + minduration: 6, + w: 640, + h: 480 + } + }, + mediaTypes: { + video: { + context: 'instream', + playerSize: [640, 480] + }, + banner: { + sizes: [ + [970, 250], + [1, 1] + ] + } + }, + adUnitCode: 'adunit-code-instream', + sizes: [[300, 250], [300, 600], [1, 1, 1], ['flex']], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + userId: {}, + schain, + }, + // banner and outream video and native { bidder: 'triplelift', params: { @@ -188,6 +326,9 @@ describe('triplelift adapter', function () { [970, 250], [1, 1] ] + }, + native: { + } }, adUnitCode: 'adunit-code-instream', @@ -261,10 +402,26 @@ describe('triplelift adapter', function () { expect(payload.imp[1].tagid).to.equal('insteam_test'); expect(payload.imp[1].floor).to.equal(1.0); expect(payload.imp[1].video).to.exist.and.to.be.a('object'); - + // banner and outstream video expect(payload.imp[2]).to.not.have.property('video'); expect(payload.imp[2]).to.have.property('banner'); expect(payload.imp[2].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}]); + // banner and incomplete video + expect(payload.imp[3]).to.not.have.property('video'); + expect(payload.imp[3]).to.have.property('banner'); + expect(payload.imp[3].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}]); + // incomplete mediatypes.banner and incomplete video + expect(payload.imp[4]).to.not.have.property('video'); + expect(payload.imp[4]).to.have.property('banner'); + expect(payload.imp[4].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}]); + // banner and instream video + expect(payload.imp[5]).to.not.have.property('banner'); + expect(payload.imp[5]).to.have.property('video'); + expect(payload.imp[5].video).to.exist.and.to.be.a('object'); + // banner and outream video and native + expect(payload.imp[6]).to.not.have.property('video'); + expect(payload.imp[6]).to.have.property('banner'); + expect(payload.imp[6].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}]); }); it('should add tdid to the payload if included', function () { @@ -587,9 +744,16 @@ describe('triplelift adapter', function () { it('should include the advertiser name in the meta field if available', function () { let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest}); - expect(result[0].meta.advertiserName).to.equal('fake advertiser name') + expect(result[0].meta.advertiserName).to.equal('fake advertiser name'); expect(result[1].meta).to.not.have.key('advertiserName'); }); + + it('should include the advertiser domain in the meta field if available', function () { + let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest}); + expect(result[0].meta.advertiserDomains[0]).to.equal('fake advertiser name'); + expect(result[0].meta.advertiserDomains.length).to.equal(1); + expect(result[1].meta).to.not.have.key('advertiserDomains'); + }); }); describe('getUserSyncs', function() { From ce9845bdc203c392f8102407879372b92b99451c Mon Sep 17 00:00:00 2001 From: Brandon Ling Date: Tue, 27 Oct 2020 11:08:26 -0400 Subject: [PATCH 16/18] remove advertiserDomains logic --- modules/tripleliftBidAdapter.js | 1 - test/spec/modules/tripleliftBidAdapter_spec.js | 8 -------- 2 files changed, 9 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 04506e49758..e4cd40a868b 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -292,7 +292,6 @@ function _buildResponseObject(bidderRequest, bid) { if (bid.advertiser_name) { bidResponse.meta.advertiserName = bid.advertiser_name; - bidResponse.meta.advertiserDomains = [bid.advertiser_name]; } }; return bidResponse; diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index e2f4841feef..d335589a4f5 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -748,14 +748,6 @@ describe('triplelift adapter', function () { expect(result[1].meta).to.not.have.key('advertiserName'); }); - it('should include the advertiser domain in the meta field if available', function () { - let result = tripleliftAdapterSpec.interpretResponse(response, {bidderRequest}); - expect(result[0].meta.advertiserDomains[0]).to.equal('fake advertiser name'); - expect(result[0].meta.advertiserDomains.length).to.equal(1); - expect(result[1].meta).to.not.have.key('advertiserDomains'); - }); - }); - describe('getUserSyncs', function() { let expectedIframeSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; let expectedImageSyncUrl = 'https://eb2.3lift.com/sync?px=1&src=prebid&gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; From 633ea112e3182532769260d1f6a29681a5599939 Mon Sep 17 00:00:00 2001 From: Brandon Ling Date: Tue, 27 Oct 2020 11:10:46 -0400 Subject: [PATCH 17/18] typo --- test/spec/modules/tripleliftBidAdapter_spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index d335589a4f5..f01949755c7 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -747,6 +747,7 @@ describe('triplelift adapter', function () { expect(result[0].meta.advertiserName).to.equal('fake advertiser name'); expect(result[1].meta).to.not.have.key('advertiserName'); }); + }); describe('getUserSyncs', function() { let expectedIframeSyncUrl = 'https://eb2.3lift.com/sync?gdpr=true&cmp_cs=' + GDPR_CONSENT_STR + '&'; From a9c63eefda80829b5fede7e0139a90e6f4f7f24d Mon Sep 17 00:00:00 2001 From: Sy Dao Date: Mon, 2 Nov 2020 14:38:23 -0800 Subject: [PATCH 18/18] update _buildResponseObject to use new instream validation --- modules/tripleliftBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 04506e49758..14ab758d9df 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -285,7 +285,7 @@ function _buildResponseObject(bidderRequest, bid) { meta: {} }; - if (breq.mediaTypes.video) { + if (_isInstreamBidRequest(breq)) { bidResponse.vastXml = bid.ad; bidResponse.mediaType = 'video'; };