-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update Rubicon Adapter with SRA-GET support (HB-2145) #13
Conversation
… test to query string param concatenation
…e for sinon 2.0 compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed the code changes, still need to review the tests.
modules/rubiconBidAdapter.js
Outdated
? memo + curr + '=' + encodeURIComponent(data[index + 1]) + '&' : memo, | ||
'' | ||
).slice(0, -1); // remove trailing & | ||
page_url = bidRequest.params.secure ? page_url.replace(/^http:/i, 'https:') : page_url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may want to put all of this page_url
logic in a function since it's used here and for video slots.
modules/rubiconBidAdapter.js
Outdated
// bids are not grouped if single request mode is not enabled | ||
requests = videoRequests.concat(bidRequests.filter(bidRequest => bidRequest.mediaType !== 'video').map(bidRequest => { | ||
const bidParams = spec.createSlotParams(bidRequest); | ||
const combinedSlotParams = spec.combineSlotUrlParams([bidParams]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you calling combineSlotUrlParams()
when this isn't single-request?
modules/rubiconBidAdapter.js
Outdated
method: 'GET', | ||
url: FASTLANE_ENDPOINT, | ||
data: Object.keys(combinedSlotParams).reduce((paramString, key) => { | ||
return (typeof combinedSlotParams[key] === 'string' || combinedSlotParams[key] !== '') ? `${paramString}${key}=${encodeURIComponent(combinedSlotParams[key])}&` : paramString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the parameter is a number, like floor
for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, wouldn't this be an &&
rather than an ||
?
modules/rubiconBidAdapter.js
Outdated
method: 'GET', | ||
url: FASTLANE_ENDPOINT, | ||
data: Object.keys(combinedSlotParams).reduce((paramString, key) => { | ||
return (typeof combinedSlotParams[key] === 'string' || combinedSlotParams[key] !== '') ? `${paramString}${key}=${encodeURIComponent(combinedSlotParams[key])}&` : paramString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments as earlier
'dt.id': digiTrustId.id, | ||
'dt.keyv': digiTrustId.keyv, | ||
'dt.pref': 0 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did this need to be changed? was it not working previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was working previously, but the get param object properties were being stored in an array (opposed to plain object) to honor ordering of parameters, but since order does not matter, I'm skipping the step of using an array. I converted this to return an object for simpler key value assignment to the param object
@@ -422,6 +449,93 @@ describe('the rubicon adapter', () => { | |||
expect(window.DigiTrust.getUser.calledOnce).to.equal(true); | |||
}); | |||
}); | |||
|
|||
describe('singleRequest config', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests confirming requests are combined as expected are good, but should have some tests verifying the params are combined into the grouped request as expected, and that the bidRequest
param is an array of all the grouped requests.
{p2: 'test'} | ||
])).to.deep.equal({p1: 'foo;foo;', p2: 'test;bar;test', p3: 'baz;;'}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('interpretResponse', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be some new tests for SRA responses.
…esponse bid could not be linked to returned ad data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new tests LGTM. thanks.
…con-project/Prebid.js into rubicon-adapter-sra-support
…rrays. Removed code/test for equal lengths between ads and bidRequests.
…ror status if only one bid was invalid
…ync (prebid#9700) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma * [RPO-3152] Enable Support for GPP Consent (#12) * Adds gpp consent integration to concert bid adapter * Update tests to check for gpp consent string param * removes user sync endpoint and tests * updates comment * cleans up consentAllowsPpid function * comment fix * rename variables for clarity * fixes conditional logic for consent allows function (#13) --------- Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com>
) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma * [RPO-3152] Enable Support for GPP Consent (#12) * Adds gpp consent integration to concert bid adapter * Update tests to check for gpp consent string param * removes user sync endpoint and tests * updates comment * cleans up consentAllowsPpid function * comment fix * rename variables for clarity * fixes conditional logic for consent allows function (#13) * [RPO-3262] Update getUid function to check for pubcid and sharedid (#14) * Update getUid function to check for pubcid and sharedid * updates adapter version --------- Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com>
…ebid#10356) * collect EIDs for bid request * add ad slot positioning to payload * RPO-2012: Update local storage name-spacing for c_uid (#8) * Updates c_uid namespacing to be more specific for concert * fixes unit tests * remove console.log * RPO-2012: Add check for shared id (#9) * Adds check for sharedId * Updates cookie name * remove trailing comma * [RPO-3152] Enable Support for GPP Consent (#12) * Adds gpp consent integration to concert bid adapter * Update tests to check for gpp consent string param * removes user sync endpoint and tests * updates comment * cleans up consentAllowsPpid function * comment fix * rename variables for clarity * fixes conditional logic for consent allows function (#13) * [RPO-3262] Update getUid function to check for pubcid and sharedid (#14) * Update getUid function to check for pubcid and sharedid * updates adapter version * [RPO-3405] Add browserLanguage to request meta object --------- Co-authored-by: antoin <antoin.campbell@voxmedia.com> Co-authored-by: Antoin <antoinfive@gmail.com> Co-authored-by: Brett Bloxom <38990705+BrettBlox@users.noreply.github.com>
IMPORTANT! Do not merge, for code review only
Type of change
Description of change
Adds "Single Request Architecture" (SRA) support to the Rubicon Adapter.
Other information
HB-2145