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

User ID's (liveramp, britepool) and gdpr #5114

Merged
merged 41 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b87237c
add video&native traffic colossus ssp
vladis-teqblaze Mar 26, 2018
1ca4e28
Native obj validation
vladis-teqblaze Apr 10, 2018
b5c1850
Native obj validation #2
vladis-teqblaze Apr 22, 2018
e969f27
Added size field in requests
vladis-teqblaze Apr 22, 2018
67693e1
fixed test
vladis-teqblaze Apr 22, 2018
e7ab418
fix merge conflicts
Nov 18, 2019
3320c68
fix merge conflicts
Nov 18, 2019
44e59b8
move to 3.0
Nov 18, 2019
7133a72
move to 3.0
Nov 18, 2019
3dba3ac
fix IE11 new URL issue
Nov 18, 2019
7f14e4d
fix IE11 new URL issue
Nov 18, 2019
78609ff
fix IE11 new URL issue
Nov 18, 2019
4c5d711
https for 3.0
Nov 20, 2019
1027b54
add https test
Nov 21, 2019
684639c
add ccp and schain features
Dec 5, 2019
1c6681c
fix test
Dec 5, 2019
436ff0f
sync with upstream, fix conflicts
Dec 5, 2019
2f9efee
sync with upstream, fix conflicts
Dec 5, 2019
c40dbe3
Update colossussspBidAdapter.js
Dec 9, 2019
7d2e9f3
Update colossussspBidAdapter.js
Dec 10, 2019
8055e57
Merge branch 'master' of https://github.com/prebid/Prebid.js
Feb 28, 2020
53bb18e
identity extensions
Feb 28, 2020
51faedc
identity extensions
Feb 28, 2020
6cee3e7
fix
Mar 6, 2020
461e4ff
fix
Mar 6, 2020
e78a9dc
fix
Mar 6, 2020
1547d0a
fix
Mar 6, 2020
803be44
fix
Mar 6, 2020
47a78af
add tests for user ids
Mar 10, 2020
9ff6f10
fix
Mar 10, 2020
b02455a
fix
Mar 10, 2020
a4b93a1
fix
Mar 10, 2020
1e74169
fix
Mar 10, 2020
74a42cd
fix
Mar 10, 2020
d65984e
fix
Mar 10, 2020
1595a00
fix
Mar 10, 2020
42c5e53
add gdpr support
Mar 10, 2020
480f127
add gdpr support
Mar 10, 2020
5d9299c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 30, 2020
3a4c32c
Merge remote-tracking branch 'upstream/master'
Apr 14, 2020
a51a3e1
id5id support
Apr 16, 2020
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
30 changes: 28 additions & 2 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ function isBidResponseValid(bid) {
}
}

function getUserId(eids, id, source, uidExt) {
if (id) {
var uid = { id };
if (uidExt) {
uid.ext = uidExt;
}
eids.push({
source,
uids: [ uid ]
});
}
}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
Expand Down Expand Up @@ -60,13 +73,17 @@ export const spec = {
'secure': location.protocol === 'https:' ? 1 : 0,
'host': location.host,
'page': location.pathname,
'placements': placements
'placements': placements,
};

if (bidderRequest) {
if (bidderRequest.uspConsent) {
request.ccpa = bidderRequest.uspConsent;
}
if (bidderRequest.gdprConsent) {
request.gdpr_consent = bidderRequest.gdprConsent.consentString || 'ALL'
request.gdpr_require = bidderRequest.gdprConsent.gdprApplies ? 1 : 0
}
}

for (let i = 0; i < validBidRequests.length; i++) {
Expand All @@ -76,11 +93,20 @@ export const spec = {
placementId: bid.params.placement_id,
bidId: bid.bidId,
sizes: bid.mediaTypes[traff].sizes,
traffic: traff
traffic: traff,
eids: []
};
if (bid.schain) {
placement.schain = bid.schain;
}
if (bid.userId) {
getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com');
getUserId(placement.eids, bid.userId.idl_env, 'identityLink');
getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com')
getUserId(placement.eids, bid.userId.tdid, 'adserver.org', {
rtiPartner: 'TDID'
});
}
placements.push(placement);
}
return {
Expand Down
31 changes: 30 additions & 1 deletion test/spec/modules/colossussspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('ColossussspAdapter', function () {
let placements = data['placements'];
for (let i = 0; i < placements.length; i++) {
let placement = placements[i];
expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes', 'schain');
expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain');
expect(placement.schain).to.be.an('object')
expect(placement.placementId).to.be.a('number');
expect(placement.bidId).to.be.a('string');
Expand All @@ -102,6 +102,35 @@ describe('ColossussspAdapter', function () {
expect(data.placements).to.be.an('array').that.is.empty;
});
});

describe('buildRequests with user ids', function () {
bid.userId = {}
bid.userId.britepoolid = 'britepoolid123';
bid.userId.idl_env = 'idl_env123';
bid.userId.tdid = 'tdid123';
bid.userId.id5id = 'id5id123'
let serverRequest = spec.buildRequests([bid], bidderRequest);
it('Returns valid data if array of bids is valid', function () {
let data = serverRequest.data;
let placements = data['placements'];
expect(data).to.be.an('object');
for (let i = 0; i < placements.length; i++) {
let placement = placements[i];
expect(placement).to.have.property('eids')
expect(placement.eids).to.be.an('array')
expect(placement.eids.length).to.be.equal(4)
for (let v of placement.eids) {
expect(v).to.have.all.keys('source', 'uids')
expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org', 'id5-sync.com'])
expect(v.uids).to.be.an('array');
expect(v.uids.length).to.be.equal(1)
expect(v.uids[0]).to.have.property('id')
expect(v.uids[0].id).to.be.oneOf(['britepoolid123', 'idl_env123', 'tdid123', 'id5id123'])
}
}
});
});

describe('interpretResponse', function () {
let resObject = {
body: [ {
Expand Down