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.32k stars 2.08k forks source link

userSync.filterSettings does not apply to Prebid Server bidders #7256

Closed stemsmit closed 1 year ago

stemsmit commented 3 years ago

Type of issue

Question / Feature Request

Description

Hello,

We're exploring user syncing with bidders via Prebid Server and when introducing the appropriate sync configuration for a specific bidder(33across) we're seeing that all Prebid Server bidders now have the capability to perform user syncs despite setting our userSync.filterSettings to only allow user syncs from one bidder 33across. I don't believe this is a bug as reviewing the PBS adapter there is no reference to userSync.filterSettings but it seems inconsistent with how the configuration would be expected to work since bid configurations for Prebid Server bidders live alongside bid configurations for client side bidders.

For confirmation; is this intentional? Would it be possible to add the functionality to the Prebid Server adapter where the userSync.filterSettings is considered when performing user syncs?

Steps to reproduce

Test page

( Chrome Incognito ) https://www.etonline.com/kristen-bell-and-dax-shepard-on-what-theyve-learned-about-each-other-from-family-game-fight-169813?pbjs_debug=true&adTargeting_test=999999&adTargeting_env=stage

Expected results

No syncs made to bidders: yieldmo, pulsepoint, triplelift, and sharethrough

Actual results

image

Platform details

OS: Windows 10 Browser: Chrome 92 ( Incognito ) Prebid.js: v4.26.0 ( but I've confirmed the issue persists in v5.5.0 )

Other information

SyntaxNode commented 3 years ago

I captured the following request to PBS-Go's User Sync endpoint on this page:

{
    "uuid": "d6bca2be-eadf-4dc6-9f9e-5ce10f50688a",
    "bidders": ["33across", "yieldmo", "pulsepoint", "triplelift", "sharethrough", "criteo"],
    "account": "76991ce3-80de-475e-99f3-781136962f72"
}

PBJS is requesting many more publishers than 33accross. @ChrisHuie Could you please investigate why that is happening in this case?

FYI: The uuid is not a valid parameter for either PBS-Go or PBS-Java and is ignored. The account parameter is currently only supported by PBS-Java, but support is in the works for PBS-Go.

bretg commented 3 years ago

So we need to filter the /cookie_sync bidders param by looking at the userSync.filterSettings.

But filterSettings is a pretty complicated data structure. Would it be ok to simplify and just look for the all object? i.e. ignore iframe- and image-specific settings.

    userSync: {
        /* only these bidders are allowed to sync.  Both iframe and image pixels are permitted. */
        filterSettings: {
            all: {
                bidders: ['abc', 'def', 'xyz'],
                filter: 'include'
            }
        },

0) start with the full /cookie_sync bidders list 1) getConfig({userSync}) 2) look for filterSettings.all if it exists: 3) if filter is 'include' then loop through the original cookie_sync.bidders list and remove any that aren't in filterSettings.all.bidders 4) if filter is 'exclude' then loop through the original cookie_sync.bidders list and remove any that are in filterSettings.all.bidders

stemsmit commented 3 years ago

So we need to filter the /cookie_sync bidders param by looking at the userSync.filterSettings.

But filterSettings is a pretty complicated data structure. Would it be ok to simplify and just look for the all object? i.e. ignore iframe- and image-specific settings.

    userSync: {
        /* only these bidders are allowed to sync.  Both iframe and image pixels are permitted. */
        filterSettings: {
            all: {
                bidders: ['abc', 'def', 'xyz'],
                filter: 'include'
            }
        },
  1. start with the full /cookie_sync bidders list
  2. getConfig({userSync})
  3. look for filterSettings.all if it exists:
  4. if filter is 'include' then loop through the original cookie_sync.bidders list and remove any that aren't in filterSettings.all.bidders
  5. if filter is 'exclude' then loop through the original cookie_sync.bidders list and remove any that are in filterSettings.all.bidders

For our use case this would suffice. I'd hesitate to say 1:1 compatibility shouldn't be the goal here but if resources are strained I can understand this being the solution until it is potentially revisited later on.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

patmmccann commented 2 years ago

it seems like adding filter settings to the pbs adapter payload is ready for dev; having pbs honor it is a ticket for the pbs board?

jlquaccia commented 1 year ago

Looked into/debugged around this ticket a bit last week, wasn't able to reproduce the original issue on my end. Might be fixed now?

bretg commented 1 year ago

Re-reading this, it seems like perhaps the issue may be the 'cooperative sync' feature?

we're seeing that all Prebid Server bidders now have the capability to perform user syncs despite setting our userSync.filterSettings to only allow user syncs from one bidder 33across.

If you turn off coopSync, /cookie_sync will only return pixels/frames defined in the bidders array

s2sConfig: {
  ...
  coopSync: false
}
jlquaccia commented 1 year ago

I can debug around that and see what I uncover. Thanks @bretg.

jlquaccia commented 1 year ago

@bretg did some more digging around this and found out the following while using the adUnit and config shown below to test:

var adUnits = [
          {
            code: "div-gpt-ad-1460505748561-0",
            mediaTypes: {
              banner: {
                sizes: [[300, 250]]
              }
            },
            bids: [
              {
                bidder: "gumgum",
                params: {
                  inScreen: "mhvb6nnu",
                }
              },
              {
                bidder: "kargo",
                params: {
                  placementId: "_j73QzQTpQ7",
                }
              },
              {
                bidder: "yahoossp",
                params: {
                  endpoint: "https://c2shb.ssp.yahoo.com/bidRequest",
                  dcn: "8a9694c7017474db0327dbf12f8f0214",
                  pos: "728x90-atf_header_desktop",
                }
              },
              {
                bidder: "appnexus",
                params: {
                  placementId: "19038935",
                }
              },
              {
                bidder: "pubmatic",
                params: {
                  publisherId: "158790",
                  adSlot: "etonline_omni-skybox-plus-sticky_728x90",
                }
              },
              {
                bidder: "rubicon",
                params: {
                  siteId: "325704",
                  accountId: 10970,
                  zoneId: "1691794",
                }
              },
              {
                bidder: "sonobi",
                params: {
                  dom_id: "omni-skybox-plus-sticky",
                  ad_unit: "/8264/aw-etonline/omni-skybox-plus-sticky",
                }
              },
              {
                bidder: "pulsepoint",
                params: {
                  cf: "728X90",
                  cp: 562342,
                  ct: 723773,
                }
              },
              {
                bidder: "ix",
                params: {
                  siteId: "483985",
                  size: [728, 90],
                }
              },
              {
                bidder: "medianet",
                params: {
                  cid: "8CUXI3IW6",
                  crid: "865445850",
                }
              },
              {
                bidder: "openx",
                params: {
                  delDomain: "cbsi-d.openx.net",
                  unit: "541025528",
                }
              },
              {
                bidder: "teads",
                params: {
                  pageId: 116491,
                  placementId: 130884,
                }
              },
              {
                bidder: "triplelift",
                params: {
                  inventoryCode: "ETOnline_DirectDisplay_PrebidS2S",
                }
              },
              {
                bidder: "trustx",
                params: {
                  uid: "15254",
                  keywords: {
                    topic: [],
                  },
                }
              },
              {
                bidder: "yieldmo",
                params: {
                  placementId: "3092371312568378220",
                }
              }
            ]
          },
        ];

        pbjs.setConfig({
          bidderTimeout: 3000,
          userSync: {
            filterSettings: {
              all: {
                bidders: ["yieldmo", "pulsepoint", "triplelift", "appnexus", "rubicon", "pubmatic"],
                filter: "include"
              }
            }
          },
          s2sConfig: {
            bidders: [
              "yieldmo",
              "pulsepoint",
              "triplelift",
              "sharethrough",
              "medianet",
            ],
            timeout: 750,
            syncTimeout: 1000,
            adapter: "prebidServer",
            enabled: true,
            accountId : '1',
            endpoint: {
              p1Consent: "https://pbs.at.cbsi.com/openrtb2/auction",
              noP1Consent: "https://pbs.at.cbsi.com/openrtb2/auction",
            },
            syncEndpoint: {
              p1Consent: "https://pbs.at.cbsi.com/cookie_sync",
              noP1Consent: "https://pbs.at.cbsi.com/cookie_sync",
            },
            coopSync: false
          },
        });

next steps.. so filterSettings look to be calling user syncs based on the include/exclude rules. should the /cookie_sync bidders param value then be respecting what is included/excluded in filterSettings?

bretg commented 1 year ago

Thanks for the research @jlquaccia. My take is that this is a documentation issue. The intention from the beginning was that s2sConfig.bidders is what defines the server-side bidders. The filterSettings came afterwards, and should, IMO, be considered secondary.

bretg commented 1 year ago

There's no way in Prebid.js to specify the filterSettings for the PBS /cookie_sync endpoint.

So that's what I'm proposing this issue tracks: updating the PBS bid adapter to copy the PBJS-defined usersync filter settings so PBS can consume them:

  1. getConfig(usersync.filterSettings)
  2. If "all" exists, copy it out into both "iframe" and "image" blocks. (PBS doesn't support "all").
  3. Don't overwrite existing "iframe" or "image" blocks. i.e. if both "all" and "image" are defined, then the "all" value will be used for "iframe", but the original "image" value takes precedence.
  4. Add the resulting JSON to the /cookie_sync POST payload as "filterSettings"
  5. Unit tests for scenarios: all only, iframe only, image and iframe, all and iframe.

That should be it.

jlquaccia commented 1 year ago

@bretg gotcha! Thanks, will create a PR soon addressing just that.

dgirardi commented 1 year ago

Closing this due to #9423 - please reopen if this is inappropriate.