Skip to content

Commit

Permalink
Smartyads Bid Adapter : add user id fields (prebid#11221)
Browse files Browse the repository at this point in the history
* Smartyads Bid Adapter/add user id fields

* smallfix

* smallfix

* smallfix tests

---------

Co-authored-by: vrishko <vasyl.rishko@smartyads.com>
  • Loading branch information
rishko00 and vrishko authored Mar 26, 2024
1 parent 8e5b35c commit 673f44f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions modules/smartyadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const spec = {
location = winTop.location;
logMessage(e);
};

let placements = [];
let request = {
'deviceWidth': winTop.screen.width,
Expand All @@ -91,7 +92,9 @@ export const spec = {
'host': location.host,
'page': location.pathname,
'coppa': config.getConfig('coppa') === true ? 1 : 0,
'placements': placements
'placements': placements,
'eeid': validBidRequests[0]?.userIdAsEids,
'ifa': bidderRequest?.ortb2?.device?.ifa,
};
request.language.indexOf('-') != -1 && (request.language = request.language.split('-')[0])
if (bidderRequest) {
Expand All @@ -111,8 +114,10 @@ export const spec = {

for (let i = 0; i < len; i++) {
let bid = validBidRequests[i];

if (i === 0) adUrl = getAdUrlByRegion(bid);
let traff = bid.params.traffic || BANNER

let traff = bid.params.traffic || BANNER;
placements.push({
placementId: bid.params.sourceid,
bidId: bid.bidId,
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/smartyadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('SmartyadsAdapter', function () {
it('Returns valid data if array of bids is valid', function () {
let data = serverRequest.data;
expect(data).to.be.an('object');
expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'coppa');
expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'coppa', 'eeid', 'ifa');
expect(data.deviceWidth).to.be.a('number');
expect(data.deviceHeight).to.be.a('number');
expect(data.coppa).to.be.a('number');
Expand Down

0 comments on commit 673f44f

Please sign in to comment.