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

Nativo Bid Adapter : changed request method to POST and added OpenRTB payload #10323

Merged
merged 62 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
38e1ade
Initial nativoBidAdapter document creation (js, md and spec)
jsfledd Feb 22, 2021
0792373
Fulling working prebid using nativoBidAdapter. Support for GDPR and C…
jsfledd Mar 12, 2021
008e906
Added defult size settings based on the largest ad unit. Added respon…
jsfledd Apr 5, 2021
21f3e0c
Changed bidder endpoint url
jsfledd Apr 7, 2021
1a33f2c
Changed double quotes to single quotes.
jsfledd Apr 7, 2021
517cd5b
Reverted package-json.lock to remove modifications from PR
jsfledd Apr 8, 2021
44bf428
Added optional bidder param 'url' so the ad server can force- match a…
jsfledd Apr 15, 2021
bfe0e1e
Lint fix. Added space after if.
jsfledd Apr 15, 2021
e927584
Added new QS param to send various adUnit data to adapter endpopint
jsfledd May 26, 2021
8ac4419
Merged latest prebid master branch
jsfledd May 26, 2021
26d8b86
Updated unit test for new QS param
jsfledd May 26, 2021
ead77de
Added qs param to keep track of ad unit refreshes
jsfledd Jul 20, 2021
4ed371c
Merged latest prebid master
jsfledd Jul 20, 2021
e59a770
Merged latest. Added adUnitCode as alternate to placementID. Removed …
jsfledd Sep 29, 2021
c338c4d
Updated bidMap key default value
jsfledd Sep 30, 2021
bfe7b02
Updated refresh increment logic
jsfledd Oct 12, 2021
06407a1
Merged latest
jsfledd Oct 25, 2021
978ffd7
Refactored spread operator for IE11 support
jsfledd Oct 25, 2021
f74f370
Updated isBidRequestValid check
jsfledd Oct 26, 2021
e1554d0
Merge branch 'master' of https://github.com/prebid/Prebid.js
jsfledd Oct 26, 2021
7b9c9bb
Refactored Object.enties to use Object.keys to fix CircleCI testing e…
jsfledd Oct 26, 2021
ffe4dc9
Merge remote-tracking branch 'Prebid_Official/master'
jsfledd Jan 14, 2022
7274900
Updated bid mapping key creation to prioritize ad unit code over plac…
jsfledd Jan 14, 2022
95cc80e
Added filtering by ad, advertiser and campaign.
jsfledd Feb 7, 2022
6b248fc
Merge remote-tracking branch 'Prebid_Official/master'
jsfledd Feb 7, 2022
bea02d0
Merge remote-tracking branch 'Prebid_Official/master'
jsfledd Feb 17, 2022
a6fc789
Merged master
jsfledd Feb 17, 2022
657b35e
merged with master
jsfledd Mar 14, 2022
2c0c8f5
Added more robust bidDataMap with multiple key access
jsfledd Mar 14, 2022
97f020d
Deduped filer values
jsfledd Mar 16, 2022
b23518f
Rolled back package.json
jsfledd Mar 30, 2022
2eeaa47
Merged with latest upstream master branch
jsfledd Mar 30, 2022
729e608
Duped upstream/master's package.lock file ... not sure how it got cha…
jsfledd Mar 30, 2022
f26e064
Small refactor of filterData length check. Removed comparison with 0 …
jsfledd Mar 30, 2022
024d010
Merge branch 'upstream_master'
jsfledd Apr 20, 2022
060ff4c
Added bid sizes to request
jsfledd Jun 6, 2022
15d34f1
Fixed function name in spec. Added unit tests.
jsfledd Jun 6, 2022
4ff5d1b
Merge branch 'upstream_master'
jsfledd Jul 8, 2022
7874280
Added priceFloor module support
jsfledd Jul 8, 2022
7619590
Added protection agains empty url parameter
jsfledd Jul 13, 2022
0bdc853
Merge branch 'upstream_master'
jsfledd Jul 13, 2022
ee52fbb
Merged with latest
jsfledd Oct 5, 2022
c5b8fab
Changed ntv_url QS param to use referrer.location instead of referrer…
jsfledd Oct 5, 2022
51ba485
Removed testing 'only' flag
jsfledd Oct 5, 2022
b682e0b
Merge branch 'upstream_master'
jsfledd Dec 9, 2022
1c02303
Merge branch 'upstream_master'
jsfledd Dec 13, 2022
b6ba5b5
Added ntv_url QS param value validation
jsfledd Dec 13, 2022
e2bed09
Merge remote-tracking branch 'PrebidOfficial/master'
jsfledd Feb 10, 2023
b629344
Merge remote-tracking branch 'PrebidOfficial/master'
jsfledd Feb 23, 2023
e04cf3d
Added userId support
jsfledd Feb 23, 2023
e9bb4ab
Added unit tests, refactored for bugs
jsfledd Feb 23, 2023
ce1b931
Wrapped ajax in try/catch
jsfledd Feb 23, 2023
a3af4e2
Added more unit testing
jsfledd Feb 23, 2023
883ebd3
Updated eid check for duplicate values. Removed error logging as we n…
jsfledd Mar 3, 2023
be48d28
Removed spec test .only. Fixed unit tests that were breaking.
jsfledd Mar 20, 2023
79880a8
Added Prebid version to nativo exchange request
jsfledd Apr 14, 2023
dbc8618
Removed unused bidder methods
jsfledd Apr 14, 2023
76f1ce7
Merge remote-tracking branch 'PrebidOfficial/master'
jsfledd May 25, 2023
3c4e169
Merge remote-tracking branch 'PrebidOfficial/master'
jsfledd Aug 7, 2023
0961ed4
Added OpenRTB payload response. Changes requerst type to POST.
jsfledd Aug 7, 2023
d090447
Removed debug log
jsfledd Aug 7, 2023
722da51
Added/fixed tests
jsfledd Aug 7, 2023
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
24 changes: 21 additions & 3 deletions modules/nativoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ import { deepAccess, isEmpty } from '../src/utils.js'
import { registerBidder } from '../src/adapters/bidderFactory.js'
import { BANNER } from '../src/mediaTypes.js'
import { getGlobal } from '../src/prebidGlobal.js'
// import { config } from 'src/config'
import { ortbConverter } from '../libraries/ortbConverter/converter.js'

const converter = ortbConverter({
context: {
// `netRevenue` and `ttl` are required properties of bid responses - provide a default for them
netRevenue: true, // or false if your adapter should set bidResponse.netRevenue = false
ttl: 30 // default bidResponse.ttl (when not specified in ORTB response.seatbid[].bid[].exp)
},
imp(buildImp, bidRequest, context) {
const imp = buildImp(bidRequest, context);
imp.tagid = bidRequest.adUnitCode
return imp;
}
});

const BIDDER_CODE = 'nativo'
const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid'
Expand Down Expand Up @@ -136,6 +149,10 @@ export const spec = {
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function (validBidRequests, bidderRequest) {
// Get OpenRTB Data
const openRTBData = converter.toORTB({bidRequests: validBidRequests, bidderRequest})
const openRTBDataString = JSON.stringify(openRTBData)

const requestData = new RequestData()
requestData.addBidRequestDataSource(new UserEIDs())

Expand Down Expand Up @@ -271,8 +288,9 @@ export const spec = {
const requestUrl = buildRequestUrl(BIDDER_ENDPOINT, qsParamStrings)

let serverRequest = {
method: 'GET',
url: requestUrl
method: 'POST',
url: requestUrl,
data: openRTBDataString,
}

return serverRequest
Expand Down
7 changes: 6 additions & 1 deletion test/spec/modules/nativoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,19 @@ describe('nativoBidAdapterTests', function () {
bidRequests = [JSON.parse(bidRequestString)]
})

it('url should contain query string parameters', function () {
it('Request should be POST, with JSON string payload and QS params should be added to the url', function () {
const request = spec.buildRequests(bidRequests, {
bidderRequestId: 123456,
refererInfo: {
referer: 'https://www.test.com',
},
})

expect(request.method).to.equal('POST')

expect(request.data).to.exist
expect(request.data).to.be.a('string')

expect(request.url).to.exist
expect(request.url).to.be.a('string')

Expand Down