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

Should prebid server listen to port 443 instead of 8000? #690

Closed
Wade-McDaniel opened this issue Sep 19, 2018 · 12 comments
Closed

Should prebid server listen to port 443 instead of 8000? #690

Wade-McDaniel opened this issue Sep 19, 2018 · 12 comments

Comments

@Wade-McDaniel
Copy link

Greetings,

I'm just getting started with Prebid Server, currently setting up the server itself indending it to work with our Google AMP ads, and I have some questions I'm hoping you can help me with:

  1. Where in the example Stored Request on this page do I specify my Prebid Server endpoint?
  2. Your readme.md seems to indicate that if I run the prebid-server I've built, it listens to port 8000. Shouldn't it listen to port 443, or do I specify port number in my endpoint URL (however i do that in fix user sync macro for index #1 above)?
  3. Is there an end-to-end example of Google AMP + Prebid Server somewhere you might point me at, or is this the only example: http://prebid.org/dev-docs/show-prebid-ads-on-amp-pages.html?

Thank you!

@dbemiller
Copy link
Contributor

dbemiller commented Sep 20, 2018

  1. In AMP, the PBS endpoint comes from the rtc-config on the AMP page itself. If you're providing Prebid as a service, you might want to add yourself as a callout vendor

  2. The port is configurable. It binds to the PBS_PORT environment variable.

  3. That's the only example I'm aware of.

@Wade-McDaniel
Copy link
Author

Thank you for helping me with this, @dbemiller !

Your answer to #2 makes sense. Thanks for that!

But I'm still confused on how to specify the Prebid Server URL in the first item on this page: http://prebid.org/dev-docs/how-prebid-on-amp-works.html
That's sort of what I was going for with my first question.

Would you know of a site that uses Prebid Server from Google AMP pages you might point me at, and I can reverse-engineer what they did to maybe figure out how to point the AMP ads in a page at the Prebid server instance I'm setting up?

@dbemiller
Copy link
Contributor

dbemiller commented Sep 20, 2018

From the docs:

<amp-ad width="300" height="250" type="doubleclick" data-slot="/19968336/universal_creative" rtc-config='{"vendors": {"prebidappnexus": {"PLACEMENT_ID": "13144370"}}, "timeoutMillis": 500}'>

Note the prebidappnexus.

The AMP project includes prebidappnexus as an rtc-config vendor:

  prebidappnexus: {
    url: 'https://prebid.adnxs.com/pbs/v1/openrtb2/amp?tag_id=PLACEMENT_ID&w=ATTR(width)&h=ATTR(height)&ow=ATTR(data-override-width)&oh=ATTR(data-override-height)&ms=ATTR(data-multi-size)&slot=ATTR(data-slot)&targeting=TGT&curl=CANONICAL_URL&timeout=TIMEOUT&adcid=ADCID&purl=HREF',
    macros: ['PLACEMENT_ID'],
    disableKeyAppend: true,
  },

That's where the URL comes from in the docs example.

As a single publisher, you might be able to just use a custom url in your rtc-config... but I'm not sure whether all the same URL macros are available there.

@Wade-McDaniel
Copy link
Author

I guess that's what makes me confused. What you sent looks to me more like the AMP Fast Fetch, where the bid requests go straight from the page to the ad partners and back to the page and then to DFP bypassing any need for Prebid Server. I don't get where any Prebid Server instance I set up fits into that equation.

I through the flow was AMP Ad -> my Prebid Server instance -> the ad partners -> my Prebid Server instance > AMP Ad -> DFP. but what you seem to describe looks more like AMP Ad -> the ad partners -> AMP Ad -> DFP. For the prebidappnexus example you sent, doesn't the amp-ad just ask prebid.adnxs.com for bids and any Prebid Server instance I set up gets ignored?

Apologies for being slow to understand how this all fits together...

@hhhjort
Copy link
Collaborator

hhhjort commented Sep 20, 2018

The prebidappnexus vendor is a "vendor" configured to hit the AppNexus hosted prebid server instance. So that example goes through a prebid server to get all bidders, it is not restricted to just AppNexus bidding.

If you are just a single publisher with your own prebid server instance, you may want to use the rtc-config: url specification rather than setting up an official vendor definition in AMP. The vendors in rtc-config are basically macro shortcuts to a url definition to make the config cleaner and smaller.

@Wade-McDaniel
Copy link
Author

Ok, so I'm not so crazy :) By default, amp-ad DOES go to each adapter endpoint hosted at each partner's server: prebidappnexus params go to prebidadnxs.com to get it's bids, rubicon goes to prebid-server.rubiconproject.com to get its' bids, etc.

But if I configure my amp-ad to be as you described, specifying a different URL for the AppNexus endpoint:
<amp-ad width="300" height="250" type="doubleclick" data-slot="/19968336/universal_creative" rtc-config='{"vendors": {"prebidappnexus": {"PLACEMENT_ID": "13144370","url":"https://myprebidserver.com/openrtb2/amp?tag_id=PLACEMENT_ID&w=ATTR(width)&h=ATTR(height)&ow=ATTR(data-override-width)&oh=ATTR(data-override-height)&ms=ATTR(data-multi-size)&slot=ATTR(data-slot)&targeting=TGT&curl=CANONICAL_URL&timeout=TIMEOUT&adcid=ADCID&purl=HREF"}}, "timeoutMillis": 500}'>
Then that will send one request back to myprebidserver.com?

If so, then how do I get my Prebid Server instance to take that one AppNexus PlacementID bid request and make requests to AppNexus and all of our other partners to get bids from everyone (everyone that supports Prebid Server that is)?

Or do I maybe just include every partner we use (that Prebid Server supports, up to 5) in the rtc-config and override each url to use myprebidserver.com?

@dbemiller
Copy link
Contributor

dbemiller commented Sep 20, 2018

For that, you need Stored Requests.

You'll need to set up some sort of backend to save that data on your server, and then configure PBS to read from it (more env variables). Right now PBS has backends for flat text files, Postgres, and a REST endpoint... but feel free to submit a PR if you have another backend in mind.

The Stored Request data should have all the Bidders & Params you need.

The AMP API is something like: /openrtb2/amp?tag_id=ID, where ID should be the ID of the Stored Request you want to run.

@hhhjort
Copy link
Collaborator

hhhjort commented Sep 20, 2018

Also not that you don't want to use both prebidappnexus and your own prebid instance. prebidappnexus is a prebid server instance that appnexus hosts, not a call to an appnexus endpoint that serves only appnexus traffic. So if you call both (and both can respond with actual bids) they will stomp on each other in setting the key values pairs for DFP.

As dbemiller noted, the tag_id=ID is an arbitrary ID that you get to define on your own prebid server instance. On the AppNexus prebid server instance, there is a convention that this ID ties to an AppNexus placement ID. This is an AppNexus convention, not a prebid server convention.

@Wade-McDaniel
Copy link
Author

OK, thanks you two! I think I'm getting it now.

So to use my own instance for AMP ads via Prebid server, I think I get

  • how to set up the Stored Request on my Prebid Server instance
  • how to set the port number prebid server should listen on to be 443 with the PBS_PORT=443 environment variable
  • and I see that if I POST to https://myprebidserver.com/openrtb2/amp?tag_id=[my_tag_id], provided that my_tag_id corresponds to a stored_requests/data/by_id/stored_imps/my_tag-id.json file for example) Prebid Server will do it's magic

The last thing that I don't understand then is: what would my tag look to use a Stored Request POST at https://myprebidserver.com/openrtb2/amp?tag_id=[my_tag_id]?

@hhhjort
Copy link
Collaborator

hhhjort commented Sep 20, 2018

Oh, one other potential issue, I don't believe prebid server will handle SSL certs ... usually you have the load balancer handle SSL certs and then all traffic use http behind that. if you are routing all traffic directly to your prebid instance then that could be an issue for https traffic.

@hhhjort
Copy link
Collaborator

hhhjort commented Sep 20, 2018

Your example above was going in the correct direction:
<amp-ad width="300" height="250" type="doubleclick" data-slot="/19968336/universal_creative" rtc-config='{"url": ["https://myprebidserver.com/openrtb2/amp?tag_id=PLACEMENT_ID&w=ATTR(width)&h=ATTR(height)&ow=ATTR(data-override-width)&oh=ATTR(data-override-height)&ms=ATTR(data-multi-size)&slot=ATTR(data-slot)&targeting=TGT&curl=CANONICAL_URL&timeout=TIMEOUT&adcid=ADCID&purl=HREF"], "timeoutMillis": 500}'>

I am just not sure on the macro support in custom URLs vs defined vendors in amp rtc.

@Wade-McDaniel
Copy link
Author

Cool, I think I can get started actually firing this thing up - thanks for all the help, @hhhjort and @dbemiller !

Regarding port 443: maybe an .htaccess proxy rule could route from myprebidserver.com:443 to localhost:8000...but I'm not sure if that'll pass the SSL certs through. But I'll cross that bridge when I get to it. I know tho that AMP requires HTTPS, and making a POST from HTTPS to HTTP should be a permissions violation, so I would think we'd need to stick with port 443.

I'm off to try this out. Thanks again!

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

No branches or pull requests

3 participants