Skip to content

Commit

Permalink
NativoBidAdapter - Added new QS param to the bid request endpoint (pr…
Browse files Browse the repository at this point in the history
…ebid#6838)

* Initial nativoBidAdapter document creation (js, md and spec)

* Fulling working prebid using nativoBidAdapter. Support for GDPR and CCPA in user syncs.

* Added defult size settings based on the largest ad unit. Added response body validation. Added consent to request url qs params.

* Changed bidder endpoint url

* Changed double quotes to single quotes.

* Reverted package-json.lock to remove modifications from PR

* Added optional bidder param 'url' so the ad server can force- match an existing placement

* Lint fix. Added space after if.

* Added new QS param to send various adUnit data to adapter endpopint

* Updated unit test for new QS param
  • Loading branch information
jsfledd authored and stsepelin committed May 28, 2021
1 parent 500b9ca commit 3e3b680
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions modules/nativoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,24 @@ export const spec = {

if (!pageUrl) pageUrl = bidderRequest.refererInfo.referer

// Build adUnit data
const adUnitData = {
adUnits: validBidRequests.map((adUnit) => {
return {
adUnitCode: adUnit.adUnitCode,
mediaTypes: adUnit.mediaTypes,
}
}),
}

// Build QS Params
let params = [
{ key: 'ntv_ptd', value: placementIds.toString() },
{ key: 'ntv_pb_rid', value: bidderRequest.bidderRequestId },
{
key: 'ntv_ppc',
value: btoa(JSON.stringify(adUnitData)), // Convert to Base 64
},
{
key: 'ntv_url',
value: encodeURIComponent(pageUrl),
Expand Down
4 changes: 3 additions & 1 deletion test/spec/modules/nativoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ describe('nativoBidAdapterTests', function () {
expect(request.url).to.be.a('string')

expect(request.url).to.include('?')
expect(request.url).to.include('ntv_url')
expect(request.url).to.include('ntv_ptd')
expect(request.url).to.include('ntv_pb_rid')
expect(request.url).to.include('ntv_ppc')
expect(request.url).to.include('ntv_url')
})
})
})
Expand Down

0 comments on commit 3e3b680

Please sign in to comment.