Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

userSync.filterSettings does not apply to Prebid Server bidders

Open stemsmit opened this issue 3 years ago • 5 comments

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

  • Use the chrome browser in incognito
  • Go to this url
  • Filter JS console log by LOG: user sync for bidder
  • Check pbjs.getConfig("userSync.filterSettings")
  • Check pbjs.getConfig("s2sConfig")

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

stemsmit avatar Aug 02 '21 22:08 stemsmit

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.

SyntaxNode avatar Aug 06 '21 16:08 SyntaxNode

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

bretg avatar Aug 13 '21 18:08 bretg

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.

stemsmit avatar Aug 13 '21 21:08 stemsmit

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.

stale[bot] avatar Jan 08 '22 23:01 stale[bot]

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?

patmmccann avatar Apr 21 '22 22:04 patmmccann

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?

jlquaccia avatar Dec 21 '22 19:12 jlquaccia

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
}

bretg avatar Dec 21 '22 20:12 bretg

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

jlquaccia avatar Dec 22 '22 18:12 jlquaccia

@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
          },
        });
  • user sync filter logic looks to be good on my end, whether using include or exclude (can see debug messages for the relative user syncs saying they were invoked. i also only tested with filterSettings.all). i also noticed that setting coopSync to true or false didn't seem to have an effect on things.
  • however, i can see that the /cookie_sync bidders param is always getting set to the same value of s2sConfig.bidders regardless of any filterSettings that have been set

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?

jlquaccia avatar Dec 22 '22 22:12 jlquaccia

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 avatar Jan 03 '23 14:01 bretg

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.

bretg avatar Jan 11 '23 21:01 bretg

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

jlquaccia avatar Jan 13 '23 00:01 jlquaccia

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

dgirardi avatar Mar 14 '23 14:03 dgirardi