Skip to content

Commit

Permalink
Teads Bid Adapter: Add ORTB2 device data to request payload (#12054)
Browse files Browse the repository at this point in the history
Co-authored-by: Bohdan V <25197509+BohdanVV@users.noreply.github.com>
  • Loading branch information
jwrosewell and BohdanVV authored Oct 10, 2024
1 parent 0471cf6 commit 1f96326
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/teadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const spec = {
networkBandwidth: getConnectionDownLink(window.navigator),
timeToFirstByte: getTimeToFirstByte(window),
data: bids,
device: bidderRequest?.ortb2?.device || {},
deviceWidth: screen.width,
deviceHeight: screen.height,
devicePixelRatio: topWindow.devicePixelRatio,
Expand Down
27 changes: 27 additions & 0 deletions test/spec/modules/teadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,33 @@ describe('teadsBidAdapter', () => {
expect(payload.viewportHeight).to.deep.equal(window.top.visualViewport.height);
});

it('should add ortb2 device data to payload', function () {
const ortb2DeviceBidderRequest = {
...bidderRequestDefault,
...{
ortb2: {
device: {
w: 980,
h: 1720,
dnt: 0,
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
language: 'en',
devicetype: 1,
make: 'Apple',
model: 'iPhone 12 Pro Max',
os: 'iOS',
osv: '17.4',
ext: {fiftyonedegrees_deviceId: '17595-133085-133468-18092'},
},
},
},
};
const request = spec.buildRequests(bidRequests, ortb2DeviceBidderRequest);
const payload = JSON.parse(request.data);

expect(payload.device).to.deep.equal(ortb2DeviceBidderRequest.ortb2.device);
});

it('should add hardwareConcurrency info to payload', function () {
const request = spec.buildRequests(bidRequests, bidderRequestDefault);
const payload = JSON.parse(request.data);
Expand Down

0 comments on commit 1f96326

Please sign in to comment.