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

Multiformat support #5

Closed
wants to merge 41 commits into from
Closed

Multiformat support #5

wants to merge 41 commits into from

Conversation

pm-manasi-moghe
Copy link
Owner

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

  • test parameters for validating bids
{
  bidder: '<bidder name>',
  params: {
    // ...
  }
}

Be sure to test the integration with your adserver using the Hello World sample page.

  • contact email of the adapter’s maintainer
  • official adapter submission

For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:

Other information

pm-shashank-jain and others added 30 commits November 27, 2018 12:45
changes to support native in pubmaticbid adapter
import { registerBidder } from 'src/adapters/bidderFactory';
import { BANNER, VIDEO, NATIVE } from 'src/mediaTypes';
import {config} from 'src/config';
const constants = require('src/constants.json');

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?

Copy link
Owner Author

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);

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?

Copy link
Owner Author

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.

} else if (sizesArrayExists) {
// delete bid.sizes;
} else {
bid.params.width = parseInt(bid.mediaTypes.banner.sizes[0][0]);

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.

Copy link
Owner Author

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]);
}
} */

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.

Copy link
Owner Author

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.

sizes = bid.mediaTypes.banner.sizes;
if (sizes !== undefined && utils.isArray(sizes)) {
if (!bid.params.width && !bid.params.height) {
bannerObj.w = sizes[0][0];

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

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.


break;
case VIDEO:
var videoData = bid.params.video;

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.


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.');

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.

}
// read playersize and assign to h and w.
if (utils.isArray(bid.mediaTypes.video.playerSize[0])) {
videoObj.w = bid.mediaTypes.video.playerSize[0][0];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseInt

// TODO: need a better way to identify mediaType from response.
function _checkMediaType(adm, newBid) {
var admStr = '';
if (adm.indexOf('<VAST version=>') >= 0) {

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) {

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

pm-manasi-moghe pushed a commit that referenced this pull request Feb 7, 2023
pm-manasi-moghe pushed a commit that referenced this pull request Feb 7, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants