Skip to content

Commit 5c310f3

Browse files
jpirosDecayConstant
authored andcommitted
Consumable Bid Adapter: add language to request (prebid#11722)
* consumableBidAdapter: add language param * consumableBidAdapter: add language param test * consumableBidAdapter: get lang from bidderRequest
1 parent 1f33a9d commit 5c310f3

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

modules/consumableBidAdapter.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export const spec = {
6161
source: [{
6262
'name': 'prebidjs',
6363
'version': '$prebid.version$'
64-
}]
64+
}],
65+
lang: bidderRequest.ortb2.device.language,
6566
}, validBidRequests[0].params);
6667

6768
if (bidderRequest && bidderRequest.gdprConsent) {

test/spec/modules/consumableBidAdapter_spec.js

+26
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ const BIDDER_REQUEST_1 = {
6666
'http://example.com/iframe1.html',
6767
'http://example.com/iframe2.html'
6868
]
69+
},
70+
ortb2: {
71+
device: {
72+
language: 'en'
73+
}
6974
}
7075
};
7176

@@ -130,6 +135,11 @@ const BIDDER_REQUEST_2 = {
130135
'http://example.com/iframe1.html',
131136
'http://example.com/iframe2.html'
132137
]
138+
},
139+
ortb2: {
140+
device: {
141+
language: 'en'
142+
}
133143
}
134144
};
135145

@@ -177,6 +187,11 @@ const BIDDER_REQUEST_VIDEO = {
177187
'http://example.com/iframe1.html',
178188
'http://example.com/iframe2.html'
179189
]
190+
},
191+
ortb2: {
192+
device: {
193+
language: 'en'
194+
}
180195
}
181196
};
182197

@@ -188,6 +203,11 @@ const BIDDER_REQUEST_EMPTY = {
188203
gdprConsent: {
189204
consentString: 'consent-test',
190205
gdprApplies: false
206+
},
207+
ortb2: {
208+
device: {
209+
language: 'en'
210+
}
191211
}
192212
};
193213

@@ -519,6 +539,12 @@ describe('Consumable BidAdapter', function () {
519539
expect(data1.placements[0].bidfloor).to.equal(0.05);
520540
expect(data2.placements[0].bidfloor).to.equal(0.15);
521541
});
542+
it('should contain the language param', function () {
543+
let request = spec.buildRequests(BIDDER_REQUEST_1.bidRequest, BIDDER_REQUEST_1);
544+
let data = JSON.parse(request.data);
545+
546+
expect(data.lang).to.equal('en');
547+
});
522548
});
523549
describe('interpretResponse validation', function () {
524550
it('response should have valid bidderCode', function () {

0 commit comments

Comments
 (0)