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

Rubicon able to read mediaTypes.size #2607

Merged
merged 6 commits into from
Jun 7, 2018
Merged

Conversation

AntoineJac
Copy link
Contributor

  • Feature

Description of change

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.

  • 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

Antoine Jacquemin (Rubicon) added 3 commits May 24, 2018 14:49
checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
@bretg bretg requested a review from snapwich May 24, 2018 07:20
@snapwich snapwich self-assigned this May 25, 2018
sizes = mapSizes(bid.mediaTypes.banner.sizes);
} else {
sizes = Array.isArray(params.sizes) ? params.sizes : mapSizes(bid.sizes)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If params.sizes is present it should be used over both bid.sizes and mediaTypes.banner.sizes, so this logic needs to be adjusted.

if (params.video && params.video.playerWidth && params.video.playerHeight) {
if (typeof utils.deepAccess(bid, 'mediaTypes.video.playerSize') !== 'undefined') {
size = bid.mediaTypes.video.playerSize;
} else if (params.video && params.video.playerWidth && params.video.playerHeight) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@idettman can you review this part to make sure this looks correct?

Copy link
Collaborator

@snapwich snapwich left a comment

Choose a reason for hiding this comment

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

please fix params.sizes to have highest priority.

@AntoineJac
Copy link
Contributor Author

@snapwich , I have edited the change to first look at Rubicon size.

Thanks,

Copy link
Collaborator

@snapwich snapwich left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@idettman idettman left a comment

Choose a reason for hiding this comment

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

I discussed with Bobby, and the only issue is changing the second and third else if positions Line #526 and #528 so that banner sizes override bid sizes if present.
So Line 524 - 532 should be:

if (Array.isArray(params.sizes)) {
    sizes = params.sizes;
} else if (typeof utils.deepAccess(bid, 'mediaTypes.banner.sizes') !== 'undefined') {
    sizes = mapSizes(bid.mediaTypes.banner.sizes);
} else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
    sizes = mapSizes(bid.sizes)
} else {
    utils.logWarn('Warning: no sizes are setup or found');
}

@AntoineJac
Copy link
Contributor Author

@idettman,
I also agree that mediaTypes.banner.sizes that be look first.
I have just made the change and commit

Thanks,

Copy link
Contributor

@idettman idettman left a comment

Choose a reason for hiding this comment

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

LGTM

@snapwich snapwich merged commit d04127a into prebid:master Jun 7, 2018
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* Rubicon able to read mediaTypes.size

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
florevallatmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Sep 6, 2018
* Rubicon able to read mediaTypes.size

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
StefanWallin pushed a commit to mittmedia/Prebid.js that referenced this pull request Sep 28, 2018
* Rubicon able to read mediaTypes.size

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this pull request Jan 30, 2019
* Rubicon able to read mediaTypes.size

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
AlessandroDG pushed a commit to simplaex/Prebid.js that referenced this pull request Mar 26, 2019
* Rubicon able to read mediaTypes.size

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
AlessandroDG pushed a commit to simplaex/Prebid.js that referenced this pull request Mar 26, 2019
* Rubicon able to read mediaTypes.size

checkBidRequestSizes is normally present in adaptermanager.js to add the mediaTypes.banner.sizes to bid.sizes. However our adapter need to be able to read these fields in case the method is deprecated.
Same for the Video.
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