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

How to create valid Stored Requests/Imps in a Prebid Server and how to call them on Client side using the Prebid.js s2s adapter #1559

Closed
nmpina opened this issue Oct 30, 2020 · 7 comments
Labels

Comments

@nmpina
Copy link

nmpina commented Oct 30, 2020

Type of issue

Can't implement successfully Stored Requests or Stored Imps in a running Prebid Server. Can't get Bids or even know if the PBS is sending the Bids correctly to the SSPs when I call the auction endpoint on the client-side.

Description

I am trying to implement the architecture described here https://docs.prebid.org/prebid-server/overview/prebid-server-overview.html
I already have a prebid server running in a server, more precisely, a docker container with the prebid-server running in a server. I've created some stored-imps in the folder /usr/local/bin/stored_requests/data/by_id/stored_imps/
The stored-imp created is this one:
{"imp":[{"id":"imp-1","banner":{"format":[{"w":300,"h":250}]},"ext":{"appnexus":{"placement_id":13144370}}}]}

The Appnexus tag is the generic testing tag available on the Prebid.js page and should return this Ad: Prebid Ad

On the client-side, I am using the PBS adapter and the s2sConfig object to configure the adapter. The configuration is this one:

pbjs.setConfig({
                s2sConfig: {
                    accountId: '****',
                    enabled: true,
                    bidders: bidders,
                    timeout: 500,
//                    endpoint: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction',
                    endpoint: 'https://test.com/openrtb2/auction',    
                }                
});

And the adUnits Object that I am pushing to pbjs is this one:

{
            path: '****',
            code:'div-ad-1',
            mediaTypes: {
                banner: {
                    sizes: size_top_mobile
                }
            },
            bids: [{
                    bidder: 'prebid',
                    params: {                        
                        storedrequest: {
                            id: "imp-1",  //eg: stored_imp
                          },
                    }
            }]
        }
    ];

pbs.yaml

The configuration file for my PBS only have this:
stored_requests: filesystem: true

Expected results

If I understand correctly the Appnexus should win the auction, the response from the server should have the winning SSPs, the currency, and the value of the winning bid among other info.

Staging page

I've created a staging where you can check the implementation client-side: [test/prebid-s2s/index.php]

Questions

  • How to create a valid stored imp with only this bidder? The one that I have is incomplete or invalid?
  • How can I verify that PBS sent all the stored imps to the Bidders?
  • How I create a valid Stored Request and why I've to put it in the same folder as stored_imps: /usr/local/bin/stored_requests/data/by_id/stored_imps/ ?
  • What kind of response should I expect from the prebid server if a Bid was sent and/or won?

I really need help with this because I know that stored requests or imps are blocks of OpenRTB stored on the server-side that is merged into OpenRTB requests sent by the Client using Prebid.js, in this case.

Thank you,

Nelson

@mansinahar
Copy link
Contributor

How to create a valid stored imp with only this bidder? The one that I have is incomplete or invalid?

From a quick look the stored imp you have looks fine to me.

How can I verify that PBS sent all the stored imps to the Bidders?

You can set the test flag in the request and then inspect the debug response which will have the final request sent to the bidder. See more info about this here

How I create a valid Stored Request and why I've to put it in the same folder as stored_imps: /usr/local/bin/stored_requests/data/by_id/stored_imps/ ?

What directory you put your stored_requests and stored_imps in depends on what you have configured for the filesystem.directorypath. It by default points to prebid-server/stored_requests/data/by_id in your prebid-server directory. You can then add stored_imps in prebid-server/stored_requests/data/by_id/stored_imps/ and stored_requests in prebid-server/stored_requests/data/by_id/stored_requests/

What kind of response should I expect from the prebid server if a Bid was sent and/or won?

You should get the bids sent by the bidders in the Prebid Server response.

Please try adding your stored requests and stored imps in the above directory path or make sure to set the filesystem.directorypath to the directory path where you are storing them and try the request again with the test flag set. Let us know if the issue still persists

@bretg
Copy link
Contributor

bretg commented Nov 12, 2020

This is the same question as #1580

  1. Prebid isn't a valid bidder code
  2. You can't specify stored-request IDs in Prebid.js. (That feature's been discussed, but not built)

Please see the example in https://docs.prebid.org/prebid-server/features/pbs-storedreqs-go.html -- the example underneath "And then POST to /openrtb2/auction with your chosen ID" -- use PostMan or curl to hit the server directly rather than going through PBJS.

@bretg
Copy link
Contributor

bretg commented Nov 13, 2020

@nmpina28 - have you worked this out to your satisfaction?

@nmpina
Copy link
Author

nmpina commented Nov 13, 2020

@nmpina28 - have you worked this out to your satisfaction?

Hi @bretg. Thank you for your response and to clarify this. Now I know that I definitely can't send the ID of a stored request using the prebid server adapter of the PBJS. Although I receive a response with bids I couldn't relate this bid with a valid bidder ID ('cause prebid isn't a valid bidder) and display the winning Ad.
What I found curious is that I can build an AdUnit object with the stored request ID and send it to my PBS using the s2s config object (with the correct endpoint and using the prebid server adapter of PBJS) and declare as a bidder: "prebid", I get a valid response with bids (appnexus, pubmatic,...) and with other bidders I get no reply, only an error message. This lent me to the mistake that I could use pbjs to send the stored request.
Resuming, to use stored requests I should create my own JSON request and sent it by XHR directly to my PBS, right? I don't need to use the prebid server adapter and the s2s config object or to be more accurate the Prebid.js And I'll receive the expected response and the Ad will be displayed in the correct placement?

Thank you for your help and apologies for the late reply.

Nelson

@nmpina
Copy link
Author

nmpina commented Nov 13, 2020

How to create a valid stored imp with only this bidder? The one that I have is incomplete or invalid?

From a quick look the stored imp you have looks fine to me.

How can I verify that PBS sent all the stored imps to the Bidders?

You can set the test flag in the request and then inspect the debug response which will have the final request sent to the bidder. See more info about this here

How I create a valid Stored Request and why I've to put it in the same folder as stored_imps: /usr/local/bin/stored_requests/data/by_id/stored_imps/ ?

What directory you put your stored_requests and stored_imps in depends on what you have configured for the filesystem.directorypath. It by default points to prebid-server/stored_requests/data/by_id in your prebid-server directory. You can then add stored_imps in prebid-server/stored_requests/data/by_id/stored_imps/ and stored_requests in prebid-server/stored_requests/data/by_id/stored_requests/

What kind of response should I expect from the prebid server if a Bid was sent and/or won?

You should get the bids sent by the bidders in the Prebid Server response.

Please try adding your stored requests and stored imps in the above directory path or make sure to set the filesystem.directorypath to the directory path where you are storing them and try the request again with the test flag set. Let us know if the issue still persists

Thank you for your answer. It helped me to understand better the way how prebid server is configured and how the request to send to the PBS should be like when using stored requests, besides the expected answer.

Cheers,

Nelson

@nmpina nmpina closed this as completed Nov 13, 2020
@nmpina nmpina reopened this Nov 13, 2020
@SyntaxNode
Copy link
Contributor

@nmpina28 I see you closed and then reopened this issue. Is there anything remaining for us to answer or addess?

@nmpina
Copy link
Author

nmpina commented Dec 14, 2020

@nmpina28 I see you closed and then reopened this issue. Is there anything remaining for us to answer or address?

Hi,
In fact, I closed it by mistake but now I'll close it because the problem is solved. With the contributions given here and some tests I performed, I can say that my issue is solved. I can now send more than one stored-imp and stored-requests (tnx @bretg for your ideas here )
So, thank you once more for all the help and support.

Cheers,

Nelson

@nmpina nmpina closed this as completed Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants