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

EngageBDR New Bid Adapter #2309

Merged
merged 9 commits into from
Mar 28, 2018
Merged

EngageBDR New Bid Adapter #2309

merged 9 commits into from
Mar 28, 2018

Conversation

jlzhangdev
Copy link
Contributor

Type of change

  • New bidder adapter

Description of change

  • test parameters for validating bids
{
  bidder: 'ebdr',
            params: {
               zoneid: '99999',
               bidfloor: '1.00',
               IDFA:'xxx-xxx',
               ADID:'xxx-xxx',
               latitude:'34.089811',
               longitude:'-118.392805'
            }
}

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

@jlzhangdev jlzhangdev mentioned this pull request Mar 22, 2018
2 tasks
@jsnellbaker jsnellbaker self-assigned this Mar 23, 2018
@jsnellbaker jsnellbaker self-requested a review March 23, 2018 13:42
Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

@jlzhangdev Thanks for submitting this new bid adapter. There are a few things that need to be updated before it's good to go. I have listed them below:

  • there are various cases where var, let, and const are used to define variables. I would recommend to be consistent and change the vars to their corresponding let or const (depending on the need).
  • The adapter indicates that it's meant to support both banner and video (via the supportedMediaTypes field). However, it seems like there's only support for banner ad units when looking through the buildRequests and interpretResponse functions. Can you take a look through the information on this page http://prebid.org/dev-docs/bidder-adaptor.html#step-1-register-the-adapter-as-supporting-video if you are planning to support video? If you're not, please update the supportedMediaTypes field.
  • Unit tests are needed for each adapter. Can you please put them together and include them in this PR? The following page has some additional information if needed (http://prebid.org/dev-docs/bidder-adaptor.html#adding-unit-tests).
  • When I was trying to test out the adapter with the provided test params using the hello_world page, I was seeing some CORS errors in the console for http://dsp.bmla.com/hb. Additionally, the response didn't seem like it came back properly; the JSON response started with a null. Can you take a look into these issues? Please see below for a copy of the entire response:
null({"id":"11789b1d475b6f","seatbid":[{"bid":[{"id":"20f947c2b44109","impid":"20f947c2b44109","price":9.81,"adid":"abcde-12345","nurl":"http://rex.bnmla.com/pixel?not=1&sid=LRX8nxQ4gX&z=16&rx=1.3392&d=3&dt=3&s=16&px=1.007999","adm":"<div><img src=\"http://cdnin.bnmla.com/0b1c6e85e9376e3092df8c9fc8ab9095.gif\" width=350 height=250 /></div>","adomain":["advertiserdomain.com"],"iurl":"http://rex.bnmla.com/pixel?not=1&sid=LRX8nxQ4gX&z=16&rx=1.3392&d=3&dt=3&s=16&px=1.007999","cid":"campaign1","crid":"abcde-12345"}],"seat":"11789b1d475b6f"}],"bidid":"11789b1d475b6f","cur":"USD"})

cpm: responseCPM,
width: ebdrBid.w,
height: ebdrBid.h,
mediaType: BANNER,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This mediaType field isn't needed in the returned bid object.

var adm = decodeURIComponent(ebdrBid.adm);
ebdrResponseImps.push({
requestId: ebdrBid.id,
bidderCode: spec.code,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This bidderCode field isn't needed in the returned bid object.

@jsnellbaker
Copy link
Collaborator

Also we need a docs PR before merge.

Please submit a PR to the docs repo to add a file for your adapter to the bidders directory so your adapter's params will appear on the bidders page.

Thanks!

@jlzhangdev
Copy link
Contributor Author

@jsnellbaker We have updated our code base to fix all those things mention in your commend.
Here is the pull request for docs repo:
prebid/prebid.github.io#685
Let me know if you find anything.

@jsnellbaker
Copy link
Collaborator

@jlzhangdev Thanks for submitting the changes and the docs PR as well. I'm reviewing over the changes now. As a note, do you have a test ad unit for video available? If so, can you provide me those test params (and perhaps include them in your .md file as well)?

I'll let you know what I find.

}
}
let _mediaTypes = bid.mediaTypes && bid.mediaTypes.video ? VIDEO : BANNER;
if (_mediaTypes == BANNER && bid.mediaTypes[_mediaTypes].sizes && bid.mediaTypes[_mediaTypes].sizes[0] && bid.mediaTypes[_mediaTypes].sizes[0].length === 2) {
Copy link
Collaborator

@jsnellbaker jsnellbaker Mar 27, 2018

Choose a reason for hiding this comment

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

This if statement doesn't verify if the bid.mediaTypes and bid.mediaTypes[_mediaTypes] objects exist. This could lead to undefined errors if the page only had adUnit.sizes defined (which may be the case with some older prebid.js supported sites).

The earlier statement for the _mediaTypes variable doesn't guarantee the bid.mediaTypes object actually exists when it assigns BANNER.

Should alter the logic here (likely in the if but perhaps in _mediaTypes) to avoid potential errors.

Fix an issue might caused undefined if it is an old bidder
@jlzhangdev
Copy link
Contributor Author

Hi @jsnellbaker,
Thank you for pointing it out. We thought it is just for upward compatible, but it is a bad case I didn't thought through. We have altered logic to prevent undefined issue.
We use if (bid.sizes && bid.sizes.length) to handle older prebid.js site. Now we add new line if (bid.mediaTypes && bid.mediaTypes[_mediaTypes]) to determine if it is for new prebid.js, and proper object exists.

Let me know if anything else might have a problem. Thanks.

@jlzhangdev
Copy link
Contributor Author

Hi @mjacobsonny, can you spec what doc do we need?

@jsnellbaker
Copy link
Collaborator

@jlzhangdev Thanks for making the change. The banner is showing fine if mediaTypes isn't defined under the adUnits.

Do you have test params for a video ad unit? If so, can you share them so I can verify the adapter for this ad type; also can you add them to your md file? If they have any unique params, please include those in your docs PR.

Thanks.

@jlzhangdev
Copy link
Contributor Author

Hi @jsnellbaker
Here the adunit for video
var adUnits = [{ code: 'video1', mediaTypes: { video: { playerSizes: [300, 250], } }, bids: [{ bidder: 'ebdr', params: { zoneid: '99998', bidfloor: '1.00', IDFA:'HelloIDFA', ADID:'GoodMorning-ADFA', latitude:'34.089811', longitude:'-118.392805' } }] }];
I also include it in md file.

@jsnellbaker
Copy link
Collaborator

Thanks @jlzhangdev for providing the video test param and updating your md file. Everything looks to be working fine now.

@jsnellbaker jsnellbaker merged commit 1b9d022 into prebid:master Mar 28, 2018
mifefr added a commit to mifefr/Prebid.js that referenced this pull request Mar 29, 2018
* 'master' of https://github.com/prebid/Prebid.js:
  EngageBDR New Bid Adapter (prebid#2309)
  [FEAT] adunit sizes support (prebid#2320)
  Support aliases in prebidServer (prebid#2257)
  Changing default currency file to https (prebid#2306)
  Update stalebot labels (prebid#2319)
  Enhance location detection within utils (prebid#2167)
  if cache markup is not enabled, set it to the default value 0 (prebid#2302)
  Serverbid Bid Adapter: Added archon alias (prebid#2293)
  Smart Ad Server: Fix bug when multi bids (prebid#2170)
  NEW adapter AdtelligentBidAdapter (prebid#2137)
  add optional param to bridgewellBidAdapter (prebid#2289)
  Increment Pre Version
  Prebid 1.6.0 Release
  Unit test fixes (prebid#2301)
  PBS videoCacheKey and vastUrl (prebid#2101)
  Add Oneplanetonly Bid Adapter (prebid#2269)
  firing new adRenderFailed event when renderAd() fails (prebid#2210)
  Add Content Ignite adapter (prebid#2268)
  add hb_cache_id, hb_uuid should be deprecated and replaced by hb_cache_id (prebid#2273)
  Update Yieldlab adapter and add official maintainer (prebid#2231)
  Update for Media.net adapter (prebid#2232)
  Update to Rubicon Adapter for mediaTypes support (prebid#2272)
  message formatting (prebid#2285)
  Yieldbot impression image creation fix (prebid#2277)
  Updated Bid params (prebid#2275)
  Audience Network: Add 'pbv' and 'cb' query params (prebid#2252)
  Add e-planning analytics adapter (prebid#2211)
  Add vastUrl for Gamma Adapter Video (prebid#2261)
  update params for test bid (prebid#2267)
  Updated adUnitCode (prebid#2262)
@jlzhangdev jlzhangdev mentioned this pull request Mar 29, 2018
2 tasks
@jsnellbaker jsnellbaker added this to the 1.7 milestone Apr 2, 2018
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* ebdr adapter 0.34.1

* ebdrBidAdapter.js 1.x

* ebdrAdapter

* update md and fix log issue

* add video support and test case for EBDR adapter

* Fix an issue for EBDR adapter

Fix an issue might caused undefined if it is an old bidder

* add vastUrl

* add video adapter in md

* fix test cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants