-
Notifications
You must be signed in to change notification settings - Fork 0
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
Multiformat support #5
Conversation
Latest Pull
Latest Code
changes to support native in pubmaticbid adapter
documentation for native
Review comments from Prebid
…into multiformat_support Conflicts: modules/pubmaticBidAdapter.js
modules/pubmaticBidAdapter.js
Outdated
import { registerBidder } from 'src/adapters/bidderFactory'; | ||
import { BANNER, VIDEO, NATIVE } from 'src/mediaTypes'; | ||
import {config} from 'src/config'; | ||
const constants = require('src/constants.json'); |
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.
are we not using constants?
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.
Its not getting used anywhere in the file. hence gulp lint was throwing an error for unused variable.
@@ -207,7 +208,7 @@ function _parseAdSlot(bid) { | |||
bid.params.adUnitIndex = '0'; | |||
bid.params.width = 0; | |||
bid.params.height = 0; | |||
var sizesArrayExists = (bid.hasOwnProperty('sizes') && utils.isArray(bid.sizes) && bid.sizes.length >= 1); | |||
// var sizesArrayExists = (bid.hasOwnProperty('sizes') && utils.isArray(bid.sizes) && bid.sizes.length >= 1); |
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.
can we delete the statement?
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.
I have just commented out old code for now, till i am testing it. Will remove all commented code before QA drop.
modules/pubmaticBidAdapter.js
Outdated
} else if (sizesArrayExists) { | ||
// delete bid.sizes; | ||
} else { | ||
bid.params.width = parseInt(bid.mediaTypes.banner.sizes[0][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.
what if mediaTypes.banner is not present? this line will throw an error.
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.
In case of prebid, for a single banner format ad, if mediaTypes is not set by publisher, prebid adds that itself. So it should not happen that mediaTypes is not present. I can add a check, just in case, but what should be the behaviour in that scenario?
bid.params.width = parseInt(bid.sizes[0][0]); | ||
bid.params.height = parseInt(bid.sizes[0][1]); | ||
} | ||
} */ |
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.
better if we delete the commented code, we can find it in older versions of code if required.
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.
yes, will delete once i am done with development.
modules/pubmaticBidAdapter.js
Outdated
sizes = bid.mediaTypes.banner.sizes; | ||
if (sizes !== undefined && utils.isArray(sizes)) { | ||
if (!bid.params.width && !bid.params.height) { | ||
bannerObj.w = sizes[0][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.
let's add parseInt() on every size: width and height.
I think the current code accepts an array of strings as well in the same format
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.
ok.
modules/pubmaticBidAdapter.js
Outdated
|
||
break; | ||
case VIDEO: | ||
var videoData = bid.params.video; |
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.
can we move following video specific code in a separate function like _createNativeRequest?
smaller functions make code easy to understand and maintain.
modules/pubmaticBidAdapter.js
Outdated
|
||
impObj.video = videoObj; | ||
} else { | ||
utils.logWarn(BIDDER_CODE + 'Error: Video config params missing for adunit: ' + bid.params.adUnit + ' with mediaType set as video. Ignoring the adunit.'); |
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.
here we are ignoring video part of the adunit, not the whole adUnit, we need to correct the message here, also for other mediaTypes.
modules/pubmaticBidAdapter.js
Outdated
} | ||
// read playersize and assign to h and w. | ||
if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { | ||
videoObj.w = bid.mediaTypes.video.playerSize[0][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.
parseInt
modules/pubmaticBidAdapter.js
Outdated
// TODO: need a better way to identify mediaType from response. | ||
function _checkMediaType(adm, newBid) { | ||
var admStr = ''; | ||
if (adm.indexOf('<VAST version=>') >= 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.
need to consider case-insensitive regex, as there will be whitespaces
version=> will not satisfy for version=3.0>
var admStr = ''; | ||
if (adm.indexOf('<VAST version=>') >= 0) { | ||
newBid.mediaType = VIDEO; | ||
} else if (adm.indexOf('span class="PubAPIAd"') >= 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.
need to consider case-insensitive regex, as there will be whitespaces
merge master into branch
* RTBHouse Bid Adapter: add global vendor list id * structured user agent - browsers.brands * fix lint errors * Added sda into rtbhouse adapter * spreading ortb2: user & site props * examples reverted * init version * using mergedeep * removed wrong imp array augm.; slot imp augm. with addtl check * [SUA] merging ortb2.device into request * fledge auctionConfig adapted to our bid response structure * new bidder response structure for fledge * make sure bidderRequest has proper flag turned on * fledge endpoint hardcoded; code cleanups * remove obsolete function * obsolete function removed * [RTB House] Process FLEDGE request/response (#4) * [SDA & SUA] refactor using mergedeep * [FLEDGE] fledge auctionConfig adapted to our bid response structure * [FLEDGE] new bidder response structure for fledge * [FLEDGE] make sure bidderRequest has proper flag turned on * [FLEDGE] fledge endpoint hardcoded; code cleanups * [FLEDGE] remove obsolete functions * fixed lint errors * fledge test suites; adapter: delete imp.ext.ae when no fledge (#5) Co-authored-by: Leandro Otani <[email protected]> Co-authored-by: rtbh-lotani <[email protected]> Co-authored-by: Tomasz Swirski <[email protected]>
Type of change
Description of change
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:
Other information