diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index 9ab5984860b..42c05f765bc 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -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); diff --git a/test/spec/modules/pubmaticBidAdapter_spec.js b/test/spec/modules/pubmaticBidAdapter_spec.js index e8bedc851c7..6e65e725024 100644 --- a/test/spec/modules/pubmaticBidAdapter_spec.js +++ b/test/spec/modules/pubmaticBidAdapter_spec.js @@ -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(); });