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

Justpremium Adapter #1227

Merged
merged 11 commits into from
Aug 14, 2017
Merged

Justpremium Adapter #1227

merged 11 commits into from
Aug 14, 2017

Conversation

mkalafior
Copy link
Contributor

Type of change

  • New bidder adapter

Description of change

New adapter from Justpremium

  • test parameters for validating bids
// example 1
{
  bidder: 'justpremium',
  params: {
    zone: 34604
  }
}
// example 2
{
  bidder: 'justpremium',
  params: {
    zone: 34604,
    allow: ['lb']
  }
}
// example 3
{
  bidder: 'justpremium',
  params: {
    zone: 34604,
    exclude: ['lb']
  }
}

@jaiminpanchal27 jaiminpanchal27 self-assigned this May 30, 2017
@jaiminpanchal27
Copy link
Collaborator

@mkalafior I see that your external js file http://d2nvliyzbo36lk.cloudfront.net/adp/bc.js playing around with pbjs global and i also see reference to winningBids
Can you elaborate what you are doing in minified js with pbjs

@mkalafior
Copy link
Contributor Author

mkalafior commented Jun 2, 2017

@jaiminpanchal27 sure, I was doing two things there (was as this is deprecated part of the code kept only for backward compatibility). At first I was detecting under which variable prebid is stored (one of our test publisher is using different name than pbjs) then I was checking if our bid was delivered on time (by listening on prebid timeout event). And at the end I was also gathering info about winning bids to understand why we lose (by tracking winning bids cpm, delivery time etc). Thats all.

@jaiminpanchal27
Copy link
Collaborator

@mkalafior no bidder adapters is allowed to track winning bids that are not their own. So update your js code accordingly.

@mkalafior
Copy link
Contributor Author

@jaiminpanchal27 i updated the code, please check it and tell me if its ok for you now.

Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a comment

Choose a reason for hiding this comment

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

I was able to get bid response back but didn't see ad loading. Can you check on that.
Also i left few comments.
Thanks

zone: zone,
hostname: d.location.hostname,
protocol: d.location.protocol.replace(':', ''),
sw: top.screen.width,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure but i think top.screen will throw error in cross domain iframe. Can you also confirm other usage of top in this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will check that.

bidmanager.addBidResponse(bid.placementCode, bidder.createBid(function (ad) {
let bidObject;
if (!ad) {
bidObject = bidfactory.createBid(2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add bid object as second parameter in createBid call. Also it would be great if you can use STATUS.GOOD constant instead of 1 defined in constants.json file

bidmanager.addBidResponse(bid.placementCode, bidObject);
bid = findBid(zone, reqBids);
}
console.error(err);
Copy link
Collaborator

Choose a reason for hiding this comment

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

}

function loadResources() {
if (toLoad.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason toLoad is array. If not than you can update this code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In development mode, instead of one file, few separated ones are loaded. For this purpose I would prefer to leave it as it is. Of course if its ok for you.

@mkalafior
Copy link
Contributor Author

@jaiminpanchal27 I updated the code and also applied most of your suggestions (I only left toLoad as an array).
But one remark here. As we are not able to serve an ad from cross origin iframe, I added a condition to detect such execution and to return empty bid then. Hope its ok for you.
Additionally I prepared a demo with our adapter here.

bidmanager.addBidResponse(bid.placementCode, bidder.createBid(function (ad) {
let bidObject;
if (!ad) {
bidObject = bidfactory.createBid(CONSTANTS.STATUS.NO_BID);
Copy link
Member

Choose a reason for hiding this comment

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

Need to pass through the bidObj from the request. Take a look at other adapters for examples

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

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

Pass through bidObj so we can get the request bid.id

@mkalafior
Copy link
Contributor Author

@mkendall07, @jaiminpanchal27 are you able to check my last commit? I followed the instruction given by @mkendall07. Is there anything else which is blocking us to merge this PR?

@ehulsbosch
Copy link

@mkendall07 could you please review the change that was requested?

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

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

LGTM. Please note that as of prebid 1.0, we won't accept bidders that load external JS for fetching demand. Only XHR requests will be supported.

@mkendall07 mkendall07 merged commit 9581c00 into prebid:master Aug 14, 2017
@mkendall07
Copy link
Member

This is merged into master. 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. Thank you for contributing

philipwatson pushed a commit to mbrtargeting/Prebid.js that referenced this pull request Sep 18, 2017
* Justpremium adapter and unit tests.

* Fix test suit.

* Performance improvements.

* Changes requested in pull request review.

* Register justpremium adapter in adaptermanager

* pass through bid from request

* fix linting errors
jbAdyoulike pushed a commit to jbAdyoulike/Prebid.js that referenced this pull request Sep 21, 2017
* Justpremium adapter and unit tests.

* Fix test suit.

* Performance improvements.

* Changes requested in pull request review.

* Register justpremium adapter in adaptermanager

* pass through bid from request

* fix linting errors
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* Justpremium adapter and unit tests.

* Fix test suit.

* Performance improvements.

* Changes requested in pull request review.

* Register justpremium adapter in adaptermanager

* pass through bid from request

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

Successfully merging this pull request may close these issues.

4 participants