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

Yandex Bid Adapter: add support for topicsFpdModule #10875

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions modules/yandexBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ export const spec = {
deepSetValue(data, 'user.ext.eids', eids);
}

const userData = deepAccess(bidRequest, 'ortb2.user.data');
if (userData && userData.length) {
deepSetValue(data, 'user.data', userData);
}

const queryParamsString = formatQS(queryParams);
return {
method: 'POST',
Expand Down
50 changes: 29 additions & 21 deletions test/spec/modules/yandexBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,37 @@ describe('Yandex adapter', function () {
expect(query['ssp-cur']).to.equal('USD');
});

it('should send eids if defined', function() {
const bannerRequest = getBidRequest({
it('should send eids and ortb2 user data if defined', function() {
const bidRequestExtra = {
userIdAsEids: [{
source: 'sharedid.org',
uids: [
{
id: '01',
atype: 1
}
]
}]
});
uids: [{ id: '01', atype: 1 }],
}],
ortb2: {
user: {
data: [
{
ext: { segtax: 600, segclass: '1' },
name: 'example.com',
segment: [{ id: '243' }],
},
{
ext: { segtax: 600, segclass: '1' },
name: 'ads.example.org',
segment: [{ id: '243' }],
},
],
},
},
};
const expected = {
ext: {
eids: bidRequestExtra.userIdAsEids,
},
data: bidRequestExtra.ortb2.user.data,
};

const bannerRequest = getBidRequest(bidRequestExtra);
const requests = spec.buildRequests([bannerRequest], bidderRequest);

expect(requests).to.have.lengthOf(1);
Expand All @@ -128,17 +146,7 @@ describe('Yandex adapter', function () {
const { data } = request;

expect(data.user).to.exist;
expect(data.user).to.deep.equal({
ext: {
eids: [{
source: 'sharedid.org',
uids: [{
id: '01',
atype: 1,
}],
}],
}
});
expect(data.user).to.deep.equal(expected);
});

describe('banner', () => {
Expand Down