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

Conversant Adapter - support User ID module #3533

Merged
Merged
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