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

Teads Bid Adapter: Add ORTB2 device data to request payload #12054

Merged
merged 2 commits into from
Oct 10, 2024
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
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