Skip to content

Commit

Permalink
Keywords + Screen resolution + CPU Core (#6259)
Browse files Browse the repository at this point in the history
Co-authored-by: sgimenez <sergi.gimenez@richaudience.com>
  • Loading branch information
richaudience and richaudience authored Feb 3, 2021
1 parent 951f1e4 commit 17ce376
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
13 changes: 12 additions & 1 deletion modules/richaudienceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export const spec = {
timeout: config.getConfig('bidderTimeout'),
user: raiSetEids(bid),
demand: raiGetDemandType(bid),
videoData: raiGetVideoInfo(bid)
videoData: raiGetVideoInfo(bid),
scr_rsl: raiGetResolution(),
cpuc: (typeof window.navigator != 'undefined' ? window.navigator.hardwareConcurrency : null),
kws: (!utils.isEmpty(bid.params.keywords) ? bid.params.keywords : null)
};

REFERER = (typeof bidderRequest.refererInfo.referer != 'undefined' ? encodeURIComponent(bidderRequest.refererInfo.referer) : null)
Expand Down Expand Up @@ -242,3 +245,11 @@ function renderAd(bid) {

window.raParams(raPlayerHB, raOutstreamHBPassback, true);
}

function raiGetResolution() {
let resolution = '';
if (typeof window.screen != 'undefined') {
resolution = window.screen.width + 'x' + window.screen.height;
}
return resolution;
}
1 change: 1 addition & 0 deletions modules/richaudienceBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Please reach out to your account manager for more information.
"pid":"ADb1f40rmo",
"supplyType":"site",
"bidfloor":0.40,
"keywords": "bici=scott;coche=audi;coche=mercedes;"
}
}]
}
Expand Down
7 changes: 5 additions & 2 deletions test/spec/modules/richaudienceBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
spec
} from 'modules/richaudienceBidAdapter.js';
import {config} from 'src/config.js';
import * as utils from 'src/utils.js';

describe('Richaudience adapter tests', function () {
var DEFAULT_PARAMS_NEW_SIZES = [{
Expand All @@ -20,7 +19,8 @@ describe('Richaudience adapter tests', function () {
params: {
bidfloor: 0.5,
pid: 'ADb1f40rmi',
supplyType: 'site'
supplyType: 'site',
keywords: 'coche=mercedes;coche=audi'
},
auctionId: '0cb3144c-d084-4686-b0d6-f5dbe917c563',
bidRequestsCount: 1,
Expand Down Expand Up @@ -240,6 +240,9 @@ describe('Richaudience adapter tests', function () {
expect(requestContent).to.have.property('transactionId').and.to.equal('29df2112-348b-4961-8863-1b33684d95e6');
expect(requestContent).to.have.property('timeout').and.to.equal(3000);
expect(requestContent).to.have.property('numIframes').and.to.equal(0);
expect(typeof requestContent.scr_rsl === 'string')
expect(typeof requestContent.cpuc === 'number')
expect(requestContent).to.have.property('kws').and.to.equal('coche=mercedes;coche=audi');
})

it('Verify build request to prebid video inestream', function() {
Expand Down

0 comments on commit 17ce376

Please sign in to comment.