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

Pass app and device fields to Prebid server #2044

Merged
merged 2 commits into from
Feb 2, 2018

Conversation

AntoineJac
Copy link
Contributor

@AntoineJac AntoineJac commented Jan 18, 2018

pbsrequest.go code is indeed developed to read the app fields present in the root of PBSRequest json not in the PBSRequest.ad_units child object. So far no app bundle is passed in the prebid server payload to the differents bidders...
With this fix, the device and app should be passed in the setConfig rather than AdUnits.

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

pbsrequest.go code is indeed developed to read the app fields present in the root of PBSRequest json not in the PBSRequest.ad_units child object. So far no app bundle is passed in the prebid server payload to the differents bidders...
With this fix, the device and app should be passed in the setConfig rather than AdUnits.
@@ -193,6 +193,8 @@ export function PrebidServer() {
/* Prebid executes this function when the page asks to send out bid requests */
baseAdapter.callBids = function(s2sBidRequest, bidRequests, addBidResponse, done, ajax) {
const isDebug = !!getConfig('debug');
const app = !!getConfig('app');
Copy link
Member

Choose a reason for hiding this comment

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

are pubs setting app and device in the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The use case here is using Postbids in an inapp environment via DFP. Nothing is explained on prebid about passing the app and device data yet so using the config seem the most relevant and logical way of doing it.

On the server code (go) all is already done to be able to read this fields and use in requests to bidders.

Copy link
Member

Choose a reason for hiding this comment

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

yeah that makes sense. If app and device are ORTB objects (and I think they are / will be soon) based on the new ORTB endpoint, then yes I think it makes sense to put these into the config as opposed to the S2S setting object. These can be used universally then vs just S2S.

@mkendall07 mkendall07 self-assigned this Jan 18, 2018
@mkendall07
Copy link
Member

@AntoineJac
I think this is good but we need a docs update to merge. I'm thinking this page should probably have some info on the structure of these items:
https://github.com/prebid/prebid.github.io/blob/master/dev-docs/get-started-with-prebid-server.md

@mkendall07
Copy link
Member

@bretg @mjacobsonny for thoughts as well.

@bretg
Copy link
Collaborator

bretg commented Jan 30, 2018

It's unclear where this scenario should be documented, but honestly the main getting-started page doesn't seem right. I view this PostBid-through-PrebidServerBidAdapter as a one-off that few pubs will need.

How about a FAQ entry?

Q: How can I use Prebid Server in a mobile app post-bid scenario?

Yes. Just schedule a creative in the ad server that:

  1. Loads Prebid JS
  2. Sets up the AdUnit
  3. Sets the app and device with setConfig along with the s2sConfig. e.g.
pbjs.setConfig({
    s2sConfig: {
    ...
    },
    app: "com.test.app",
    device: "WHAT_VALUES_DOES_THIS_TAKE?"
});

So I'm proposing this goes here -- http://prebid.org/dev-docs/faq.html . @rmloveland ?

@AntoineJac
Copy link
Contributor Author

Do you please have any ETA for this release to be deployed?

@mkendall07
Copy link
Member

@AntoineJac
I don't think we have any issues with the code - but we need a docs PR.
@bretg
I'm good with the FAQ.

Separately we should have a dedicated setConfig API page.

@mkendall07 mkendall07 added the LGTM label Feb 2, 2018
@mkendall07 mkendall07 assigned bretg and unassigned mkendall07 Feb 2, 2018
@bretg
Copy link
Collaborator

bretg commented Feb 2, 2018

@AntoineJac and I are going to revise the interface to better reflect OpenRTB:

pbjs.setConfig({
    s2sConfig: {
    ...
    },
    app: {
        bundle: "com.test.app"
    },
    device: {
         ifa: "6D92078A-8246-4BA4-AE5B-76104861E7DC"
    }
});

Also, we think the 'app' and 'device' args for the PBS /auction endpoint are objects, not strings. Antoine is confirming, and then I'll submit a doc PR

@bretg
Copy link
Collaborator

bretg commented Feb 2, 2018

doc PR submitted prebid/prebid.github.io#588

@bretg bretg assigned mkendall07 and unassigned bretg Feb 2, 2018
@bretg
Copy link
Collaborator

bretg commented Feb 2, 2018

doc PR open. back to you @mkendall07

@bretg bretg added this to the Prebid 1.3 release milestone Feb 2, 2018
@mkendall07 mkendall07 merged commit 7773f58 into prebid:master Feb 2, 2018
@bretg
Copy link
Collaborator

bretg commented Feb 7, 2018

This PR created a bug -- Prebid Server can't handle getting app and device parameters.

@matthewlane
Copy link
Collaborator

I just ran into this as well. I think it's because device and app are being converted to booleans (with !!getConfig('app');) rather than passed as objects. Dropping the boolean conversion may fix this

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