prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.33k stars 2.08k forks source link

Feature: s2sTesting support for suppressing client-based bids #3853

Closed bretg closed 5 years ago

bretg commented 5 years ago

Type of issue

Feature

Summary

Support a mode in the s2sTesting module where only server-side bids will be made

Description

One of the greatest limitations of client-side integrations is its reliance on the browser to process many responses. To improve publisher's ability to measure the impact of server-side header bidding, we've been asked to support a scenarios where all bidders happen via the Server path.

The proposal is to add a new optional testServerOnly flag that integrates with PBJS core to suppress client-side bids when: 1) testing: true 2) at least one server-side bidder matches the A/B test percent

This should be implemented as a filter that runs after all existing server/client determination runs -- if at least one bidder runs server, but some other bidders were chosen as client-side for A/B testing, they will not be run. This scenario shouldn't happen with the recent 'global random' unless different client/server ratios are chosen.

When this mode is activated, there will never be a mix of client and server.

e.g.

pbjs.setConfig(
  s2sConfig: {
     bidders: [ "rubicon", "appnexus" ],
     testing: true,
     testServerOnly: true,
     bidderControl: {
         "rubicon": {
             bidSource: {server:10, client:90},
             includeSourceKvp: true
         },
         "appnexus": {
             bidSource: {server: 10, client:90},
             includeSourceKvp: true
         }
     }
});

In this configuration, 90% of the time all bidders happen client-side. 10% of the time, both rubicon and appnexus go through the server AND any client-side bidders are ignored.

The goal here is to get an accurate view of the impact of s2s, and having the browser be busy with bidders that don't support server may be minimizing the perceived benefit of server.

If we find that using server saves the browser cycles and improves header bidding, other bidders will have incentive to build server-side adapters.

In reviewing with the Prebid.js committee, it came up that session-based sampling is the best practice. Prebid.js should not be setting cookies to support implementation of that feature, but it can be done by the publisher.

Assuming the pub has set up a session-sampling cookie and has stored the results in pbjs.isSampledSession, they could configure the test with:

if (pbjs.isSampledSession) {
pbjs.setConfig(
  s2sConfig: {
     bidders: [ "rubicon", "appnexus" ],
     testing: true,
     testServerOnly: true,
     bidderControl: {
         "rubicon": {
             bidSource: {server:100},
             includeSourceKvp: true
         },
         "appnexus": {
             bidSource: {server: 100},
             includeSourceKvp: true
         }
     }
});
}

Finally, an example:

1) Bidders A,B,C, and D are attached to the adunit 2) Bidders A and B are in s2sConfig. Bidder A is 10% server and 90% client. Bidder B is 50%/50% 3) The random number chosen is 34. Therefore, only Bidder B will go server-side. A,C, and D are client side 4) the testServerOnly flag is on, so A,C,D are suppressed. Only B participates in the auction server-side.

harpere commented 5 years ago

@bretg is the converse true? if some bidders are server only (in bidders list but not in bidderControl), the testServerOnly flag is true, and s2sTesting returns client - should it do client only? Or in that case should there be a mix of client and server?

bretg commented 5 years ago

When testServerOnly flag is true, there should never be client-side activity.

harpere commented 5 years ago

I got it now - the testServerOnly flag only comes into play when there are bidders in bidderControl that choose "server". Otherwise nothing changes.