Skip to content

Commit

Permalink
Conversant Adapter - support User ID module (#3533)
Browse files Browse the repository at this point in the history
* added universal id support to bid adapter

* added unit test for universal id support

* added universal id support to bid adapter

* added unit test for universal id support

* renamed universalId to userId

* removed old code from merge mistake

* test for unit test
  • Loading branch information
Isaac Dettman authored and bretg committed Apr 29, 2019
1 parent f350bba commit e31b9d8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export const spec = {
imp.banner = banner;
}

if (bid.crumbs && bid.crumbs.pubcid) {
if (bid.userId && bid.userId.pubcid) {
pubcid = bid.userId.pubcid;
} else if (bid.crumbs && bid.crumbs.pubcid) {
pubcid = bid.crumbs.pubcid;
}

Expand Down
13 changes: 13 additions & 0 deletions test/spec/modules/conversantBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,19 @@ describe('Conversant adapter tests', function() {
expect(payload).to.have.deep.nested.property('user.ext.fpc', 12345);
});

it('Verify User ID publisher commond id support', function() {
// clone bidRequests
let requests = utils.deepClone(bidRequests)

// add pubcid to every entry
requests.forEach((unit) => {
Object.assign(unit, {userId: {pubcid: 67890}});
});
// construct http post payload
const payload = spec.buildRequests(requests).data;
expect(payload).to.have.deep.nested.property('user.ext.fpc', 67890);
});

it('Verify GDPR bid request', function() {
// add gdpr info
const bidRequest = {
Expand Down

0 comments on commit e31b9d8

Please sign in to comment.