Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubicon: LiveIntent support in RP Adapter and PBS Adapter update to pass segments #4303

Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8d635ff
Add microadBidAdapter
Feb 15, 2019
3055b90
Remove unnecessary encodeURIComponent from microadBidAdapter
Feb 26, 2019
67fb91b
Submit Advangelists Prebid Adapter
Feb 26, 2019
3ebb916
Submit Advangelists Prebid Adapter 1.1
Feb 27, 2019
4f5c451
Correct procudtion endpoint for prebid
Feb 28, 2019
2dc6d1d
Merge branch 'microad-bid-adapter' of git://github.com/strong-zero/Pr…
Feb 28, 2019
fa3e081
Merge remote-tracking branch 'origin/master' into master-rubicon-clean
Mar 18, 2019
600a46e
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Mar 18, 2019
7f578b3
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 23, 2019
176a312
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 26, 2019
9abf89c
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 13, 2019
6ce04ab
Merge remote-tracking branch 'upstream/master'
Jun 10, 2019
415e2f6
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jun 27, 2019
61fb82c
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 11, 2019
3cc4c67
analytics update with wrapper name
Jul 11, 2019
cd81e02
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 15, 2019
e2b4e04
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 15, 2019
53b5970
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 15, 2019
5c00ed5
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 16, 2019
28848ad
reverted error merge
Jul 16, 2019
ab635ee
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 19, 2019
93308f5
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 24, 2019
1cfd52d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 25, 2019
d619807
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 27, 2019
9893f0f
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 7, 2019
986a251
Merge remote-tracking branch 'upstream/master'
Aug 23, 2019
2cae7c0
Merge branch 'master' of https://github.com/prebid/Prebid.js into ori…
Aug 27, 2019
d7fd252
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 4, 2019
c7c01ba
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 10, 2019
24a28aa
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 10, 2019
7a1a4ec
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
Sep 25, 2019
4173d16
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 25, 2019
ca13952
update changed default value of netRevenue to true
Sep 27, 2019
0b6cd48
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 3, 2019
5f0110d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 3, 2019
f930a34
Merge remote-tracking branch 'upstream/master'
Oct 8, 2019
9bff282
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 14, 2019
82986d2
added semi-colon
Oct 14, 2019
6f7d2dd
update eid source to use domain
Oct 14, 2019
ed73312
update video oRTB with liveintent segments
Oct 29, 2019
712ec9e
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 29, 2019
26c752b
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js…
Oct 29, 2019
b4f9769
update pbs adapter with liveintent segments support
Oct 29, 2019
2436983
update rp adapter liveintent support for fastlane
Oct 29, 2019
84219d9
Merge branch 'master' of https://github.com/prebid/Prebid.js into upd…
Oct 29, 2019
3475e9d
reverted package lock, fix for unintentional update
Oct 29, 2019
b1605e5
added unit tests for fastlane.json and ortb, fix to join segments wit…
Oct 29, 2019
67fa6c1
fix obj property path data.tpid
Oct 30, 2019
8ae119a
update remove unnecessary function call
Oct 30, 2019
f8f87e5
re-ordering query string params
bretg Oct 31, 2019
a02b4f7
Merge branch 'master' of https://github.com/prebid/Prebid.js into upd…
Oct 31, 2019
235b20a
Merge branch 'master' of https://github.com/prebid/Prebid.js into upd…
Oct 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,12 +731,19 @@ const OPEN_RTB_PROTOCOL = {
}

if (bidUserId.lipb && bidUserId.lipb.lipbid) {
request.user.ext.eids.push({
const liveIntent = {
source: 'liveintent.com',
uids: [{
id: bidUserId.lipb.lipbid
}]
});
};

if (Array.isArray(bidUserId.lipb.segments) && bidUserId.lipb.segments.length) {
liveIntent.ext = {
segments: bidUserId.lipb.segments
};
}
request.user.ext.eids.push(liveIntent);
}
}

Expand Down
41 changes: 36 additions & 5 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export const spec = {
}

if (bidRequest.userId && typeof bidRequest.userId === 'object' &&
(bidRequest.userId.tdid || bidRequest.userId.pubcid)) {
(bidRequest.userId.tdid || bidRequest.userId.pubcid || bidRequest.userId.lipb)) {
utils.deepSetValue(data, 'user.ext.eids', []);

if (bidRequest.userId.tdid) {
Expand All @@ -231,6 +231,25 @@ export const spec = {
}]
});
}

// support liveintent ID
if (bidRequest.userId.lipb && bidRequest.userId.lipb.lipbid) {
data.user.ext.eids.push({
source: 'liveintent.com',
uids: [{
id: bidRequest.userId.lipb.lipbid
}]
});

data.user.ext.tpid = {
source: 'liveintent.com',
uid: bidRequest.userId.lipb.lipbid
};

if (Array.isArray(bidRequest.userId.lipb.segments) && bidRequest.userId.lipb.segments.length) {
utils.deepSetValue(data, 'rp.target.LIseg', bidRequest.userId.lipb.segments);
}
}
}

if (config.getConfig('coppa') === true) {
Expand Down Expand Up @@ -301,7 +320,6 @@ export const spec = {
const containsTgI = /^tg_i/

const orderedParams = [
'tpid_tdid',
'account_id',
'site_id',
'zone_id',
Expand All @@ -310,10 +328,13 @@ export const spec = {
'p_pos',
'gdpr',
'gdpr_consent',
'rf',
'tpid_tdid',
'tpid_liveintent.com',
'tg_v.LIseg',
'dt.id',
'dt.keyv',
'dt.pref',
'rf',
'p_geo.latitude',
'p_geo.longitude',
'kw'
Expand Down Expand Up @@ -409,8 +430,18 @@ export const spec = {
// For SRA we need to explicitly put empty semi colons so AE treats it as empty, instead of copying the latter value
data['p_pos'] = (params.position === 'atf' || params.position === 'btf') ? params.position : '';

if ((bidRequest.userId || {}).tdid) {
data['tpid_tdid'] = bidRequest.userId.tdid;
if (bidRequest.userId) {
if (bidRequest.userId.tdid) {
data['tpid_tdid'] = bidRequest.userId.tdid;
}

// support liveintent ID
if (bidRequest.userId.lipb && bidRequest.userId.lipb.lipbid) {
data['tpid_liveintent.com'] = bidRequest.userId.lipb.lipbid;
if (Array.isArray(bidRequest.userId.lipb.segments) && bidRequest.userId.lipb.segments.length) {
data['tg_v.LIseg'] = bidRequest.userId.lipb.segments.join(',');
}
}
}

if (bidderRequest.gdprConsent) {
Expand Down
6 changes: 5 additions & 1 deletion test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,8 @@ describe('S2S Adapter', function () {
pubcid: '1234',
parrableid: '01.1563917337.test-eid',
lipb: {
lipbid: 'li-xyz'
lipbid: 'li-xyz',
segments: ['segA', 'segB']
}
};

Expand All @@ -1066,6 +1067,9 @@ describe('S2S Adapter', function () {
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'parrable.com')[0].uids[0].id).is.equal('01.1563917337.test-eid');
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'liveintent.com')).is.not.empty;
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'liveintent.com')[0].uids[0].id).is.equal('li-xyz');
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'liveintent.com')[0].ext.segments.length).is.equal(2);
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'liveintent.com')[0].ext.segments[0]).is.equal('segA');
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'liveintent.com')[0].ext.segments[1]).is.equal('segB');
});

it('when config \'currency.adServerCurrency\' value is an array: ORTB has property \'cur\' value set to a single item array', function () {
Expand Down
46 changes: 46 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ describe('the rubicon adapter', function () {
'playerWidth': 640,
'size_id': 201,
};
bid.userId = {
lipb: {
lipbid: '0000-1111-2222-3333',
segments: ['segA', 'segB']
}
}
}

function createVideoBidderRequestNoVideo() {
Expand Down Expand Up @@ -1147,6 +1153,36 @@ describe('the rubicon adapter', function () {

expect(data['tpid_tdid']).to.equal('abcd-efgh-ijkl-mnop-1234');
});

describe('LiveIntent support', function () {
it('should send tpid_liveintent.com when userId defines lipd', function () {
const clonedBid = utils.deepClone(bidderRequest.bids[0]);
clonedBid.userId = {
lipb: {
lipbid: '0000-1111-2222-3333'
}
};
let [request] = spec.buildRequests([clonedBid], bidderRequest);
let data = parseQuery(request.data);

expect(data['tpid_liveintent.com']).to.equal('0000-1111-2222-3333');
});

it('should send tg_v.LIseg when userId defines lipd.segments', function () {
const clonedBid = utils.deepClone(bidderRequest.bids[0]);
clonedBid.userId = {
lipb: {
lipbid: '1111-2222-3333-4444',
segments: ['segD', 'segE']
}
};
let [request] = spec.buildRequests([clonedBid], bidderRequest);
const unescapedData = unescape(request.data);

expect(unescapedData.indexOf('&tpid_liveintent.com=1111-2222-3333-4444&') !== -1).to.equal(true);
expect(unescapedData.indexOf('&tg_v.LIseg=segD,segE&') !== -1).to.equal(true);
});
});
})
});

Expand Down Expand Up @@ -1184,6 +1220,16 @@ describe('the rubicon adapter', function () {
expect(imp.ext.rubicon.video.skip).to.equal(1);
expect(imp.ext.rubicon.video.skipafter).to.equal(15);
expect(post.user.ext.consent).to.equal('BOJ/P2HOJ/P2HABABMAAAAAZ+A==');
expect(post.user.ext.eids[0].source).to.equal('liveintent.com');
expect(post.user.ext.eids[0].uids[0].id).to.equal('0000-1111-2222-3333');
expect(post.user.ext.tpid).that.is.an('object');
expect(post.user.ext.tpid.source).to.equal('liveintent.com');
expect(post.user.ext.tpid.uid).to.equal('0000-1111-2222-3333');
expect(post.rp).that.is.an('object');
expect(post.rp.target).that.is.an('object');
expect(post.rp.target.LIseg).that.is.an('array');
expect(post.rp.target.LIseg[0]).to.equal('segA');
expect(post.rp.target.LIseg[1]).to.equal('segB');
expect(post.regs.ext.gdpr).to.equal(1);
expect(post).to.have.property('ext').that.is.an('object');
expect(post.ext.prebid.targeting.includewinners).to.equal(true);
Expand Down