Skip to content

Commit

Permalink
Sending device.language in iso standard 2 characters (#8789)
Browse files Browse the repository at this point in the history
Co-authored-by: Kapil Tuptewar <[email protected]>
  • Loading branch information
kapil-tuptewar and Kapil Tuptewar authored Aug 5, 2022
1 parent cdb290c commit a93a7c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,9 @@ export const spec = {
payload.device = Object.assign(payload.device, config.getConfig('device'));
}

// update device.language to ISO-639-1-alpha-2 (2 character language)
payload.device.language = payload.device.language && payload.device.language.split('-')[0];

// passing transactionId in source.tid
deepSetValue(payload, 'source.tid', conf.transactionId);

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ describe('PubMatic adapter', function () {
expect(data.device.dnt).to.equal((navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0);
expect(data.device.h).to.equal(screen.height);
expect(data.device.w).to.equal(screen.width);
expect(data.device.language).to.equal(navigator.language);
expect(data.device.language).to.equal(navigator.language.split('-')[0]);
expect(data.device.newkey).to.equal('new-device-data');// additional data from config
sandbox.restore();
});
Expand Down

0 comments on commit a93a7c9

Please sign in to comment.