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

Support Prebid Server stored impression scenario #7027

Closed
muuki88 opened this issue Jun 15, 2021 · 11 comments · Fixed by #8154
Closed

Support Prebid Server stored impression scenario #7027

muuki88 opened this issue Jun 15, 2021 · 11 comments · Fixed by #8154
Assignees
Labels

Comments

@muuki88
Copy link
Collaborator

muuki88 commented Jun 15, 2021

Type of issue

Bug / Feature Request

Description

A bidder is not available in the bidIdMap if there's no bid configure on the client.

let bidRequest;
let key = `${bid.impid}${seatbid.seat}`;
if (bidIdMap[key]) {
bidRequest = utils.getBidRequest(
bidIdMap[key],
bidderRequests
);
}

The bidRequest is undefined and throws a error later on when trying to access the bidId

bidObject.requestId = bidRequest.bidId || bidRequest.bid_Id;

Steps to reproduce

  1. Configure an adUnit with Bidder A for server side and a stored impression id
  2. The stored impression server side requests Bidder B
  3. If a bid is returned an exception will be thrown cannot access bidId of undefined

Sample config on client side

const adUnit = {
  mediaType: { banner: { sizes: [[300, 250]] } },
  ortb2Imp: { ext: { prebid: { storedrequest: { id: 'ad-slot-1' } } } },
  bids: [ { bidder: 'Bidder A', params { } }  ]
}

const s2sConfig = {
  // ...
  bidders: [ 'Bidder A', 'Bidder B' ]
}

And on server side

    {
      "id": "ad-slot-1",
      "banner": {
        "format": [    ]
      },
      "ext": {
        "prebid": {
          "bidder": {
            "Bidder B": {
              "placement_id": 1234
            }
          }
        }
      }
    }

Test page

None

Expected results

  • No exception is thrown
  • Bidder B is properly handled

Actual results

Exception

Platform details

  • prebid.js 4.43.0
  • prebid server java 1.66.0

Other information

@muuki88
Copy link
Collaborator Author

muuki88 commented Jun 15, 2021

There is a simple workaround that feels wrong, but works 😂 If you add an "empty" bid with the corresponding bidder code, it works

const adUnit = {
  mediaType: { banner: { sizes: [[300, 250]] } },
  ortb2Imp: { ext: { prebid: { storedrequest: { id: 'ad-slot-1' } } } },
  bids: [ 
     { bidder: 'Bidder A', params { } },
     // the client adapter is not required to make this work!
     { bidder: 'Bidder B', params { } },
  ]
}

@bretg
Copy link
Collaborator

bretg commented Jun 15, 2021

Thanks for writing this up in detail @muuki88.

We just need to decide if getting an "unknown" bidder back from PBS is always fine. I guess we have no choice. I'd suggest adding an informational log entry -- e.g. "received bid from server-only bidder: BidderA"

Any objections? Any volunteers? (@mmoschovas ? @idettman ?)

FWIW, this is somewhat related to #6361

@muuki88
Copy link
Collaborator Author

muuki88 commented Jun 15, 2021

I was thinking about the bidders array that is already present in the s2sConfig. From a developer perspective this looks like the place to "allow" bidders.

@gglas
Copy link

gglas commented Jun 21, 2021

Issue review came to exact same conclusion -- just need a volunteer to add the feature.

@muuki88
Copy link
Collaborator Author

muuki88 commented Dec 1, 2021

If you use the workaround mentioned in #7027 (comment) you also need to make sure that

  • if you enable the gdprEnforcement module to add the server side bidders to the vendor exceptions, as there's no gvlid if the bid adapter is not imported
  • add all vendors to the bidders list in the s2s config

@dgirardi
Copy link
Collaborator

related to #7688

@bretg
Copy link
Collaborator

bretg commented Dec 16, 2021

The plan is to solve with with #7688.

  • Logging: doesn't need to have a special message. Let's just make sure a console log indicates the bid response from the unexpected bidder.
  • GDPR:
    • cookie_sync: I propose letting PBS handle Purpose 1 enforcement. Pass the list of known bidders-in-page on s2sConfig.bidders. Let PBS look up the GVL ID from the biddercode. For custom client-side aliases, the JS /cookie_sync code should map the alias to the actual server-side adapter. e.g. pbjs.aliasBidder('appnexus', 'newAlias') would result in the cookie_sync sending appnexus rather than newAlias.
    • For the auction, PBS should look up GVLID for each bidder. It should not need to be enforced client-side, and should not be necessary in the request. We should not have to add a vendor-exception for PBJS to initiate the PBS auction. PBS is expected to handle legal basis for every bidder.

@muuki88
Copy link
Collaborator Author

muuki88 commented Jan 1, 2022

Sounds good to me ☺️

Should we close this issue then as a duplicate?

@bretg bretg changed the title bidRequest is undefined for Prebid Server stored impressions Support Prebid Server stored impression scenario Jan 12, 2022
@bretg
Copy link
Collaborator

bretg commented Jan 12, 2022

Good progress has been made on #7688, but we've found that the scenario in this issue needs a little more work.

What we'd like to support is

const adUnit = {
  mediaType: { banner: { sizes: [[300, 250]] } },
  ortb2Imp: { ext: { prebid: { storedrequest: { id: 'ad-slot-1' } } } },
  // "look mom, no bids array!"
}

PBJS-core would need to be be updated to deal cleanly with the scenario that an adunit doesn't contain bids. It's possible that one adunit in an auction contains bids while another doesn't. I'd suggest:

  • if no bids array and no ortb2Imp, log a major warning
  • if no bids array but at least ortb2Imp is specified, log an informational entry

The pbsBidAdapter would need to be updated to deal with it: if no bids array is found in the adunit, create the openrtb without imp[].ext.prebid.bidders

@bretg
Copy link
Collaborator

bretg commented Mar 4, 2022

Discussed with @dgirardi - we agreed that the signal for the pbsBidAdapter to emit a stored-imp-only imp object should be implicit: if an AdUnit contains no bids array and does contain ortb2Imp, it will add the imp object.

We considered having an explicit signal (e.g. s2sConfig.bidders: ["*"]) but realized that could get confusing in a scenario where some adunits are server-only and some are a mix of client and server.

@bretg
Copy link
Collaborator

bretg commented Jun 26, 2024

Also related to the Prebid.less proposal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

6 participants