New Prebid1.0 adapter for SpotX#3472
Conversation
modules/spotxBidAdapter.js
Outdated
| import * as utils from 'src/utils'; | ||
| import { Renderer } from 'src/Renderer'; | ||
| import { registerBidder } from 'src/adapters/bidderFactory'; | ||
| import { VIDEO } from 'src/mediaTypes'; |
There was a problem hiding this comment.
robertrmartinez
left a comment
There was a problem hiding this comment.
Just minor nit pick about unused imports in spec file!
Otherwise this LGTM!
One note is you are juuuuust above the 80% Test Coverage threshold.
Maybe in future PRs we can get that number up!
gulp test-coverage and you can pick out a few lines to cover next time!
Thanks, once those unused imports are fixed we can merge for next Tuesdays Release!
|
|
||
| // Add GDPR flag and consent string | ||
| if (bidderRequest && bidderRequest.gdprConsent) { | ||
| userExt.consent = bidderRequest.gdprConsent.consentString; |
There was a problem hiding this comment.
If a pub enables the consent modul, but for some reason the consent information cannot be found,
then prebid passes an object like so to the bidders:
{
gdprConsent: {
consentString: undefined
gdprApplies: undefined
vendorData: undefined
}
}So technically your userExt would be:
{
consent: undefined
}at this point, but it gets pruned before the request eventually gets sent by prebid so no big deal, just though I would make aware that Prebid passes those undefined values in some instances!
There was a problem hiding this comment.
Our ad server should handle undefined in those requests anyways, but that's good to know!
| import {config} from 'src/config'; | ||
| import * as utils from 'src/utils'; | ||
| import find from 'core-js/library/fn/array/find'; | ||
|
|
There was a problem hiding this comment.
Almost all of these imports are never used besides expect and spec
Can you remove the unused ones?
Both CONSTANTS as well as INTEGRATION below here are not used either.
Let me know if I missed something and there is a reason for keeping them!
There was a problem hiding this comment.
Updated. I went ahead and wrote a few more tests while I was in there to bump that coverage up a bit.
There was a problem hiding this comment.
Awesome!! Thanks for that.
robertrmartinez
left a comment
There was a problem hiding this comment.
Great stuff! Thanks!
Type of change
Description of change
Creating a new SpotX Bidder Adapter
Be sure to test the integration with your adserver using the Hello World sample page.
For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide: