-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Prebid incorrectly builds syncOptions, when the Publisher sets different permissions for different bidders #12613
Comments
Update The best way to do this is, IMO, by using isActivityAllowed to build correct syncOptions for each bidder. In such case, we would call getUserSyncs in the following manner I have updated https://github.com/grupawp/Prebid.js/blob/fix-registerSyncInner/src/adapters/bidderFactory.js and Test5 accordingly. |
Hi @wojciech-bialy-wpm , thanks so much for the bug report! Would you mind submitting your branch as a pr? Please click allow maintainers to make change on submission to expedite merge |
Hi @patmmccann, certainly! I have created a PR here: #12615 (using a new branch, as the old one that I've used in the last test had some leftover clutter from previous attempt to update sync options) |
Hmm... test/spec/unit/core/bidderFactory_spec.js now has 3 failing tests, all pertaining to bidder aliases. I'll look into that. By itself, user syncs for aliases work. See https://bdr.wpcdn.pl/tests/usersyncs/sspbc-6.10-mixed_sync_4.html, where we have sspBC (as before) and matomy (alias for appnexus). This test will (correctly) execute image sync for sspBC and iframe sync for matomy. EDIT: Failing tests only check whether filterSettings are being read |
Type of issue
Bug
Description
When Prebid.js constructs syncOptions (via bidderFactory -> registerSyncInner), it does not check per bidder permissions - only checking if image / iframe / all properties exist.
Because of that, if Publisher enables image syncs for all bidders, but restricts iframe sync to one bidder only
filterSettings: { image: { bidders: '*', filter: 'include' }, iframe: { bidders: ['someBidder'], filter: 'include' } }
Then all bidders will receive
syncOptions = {iframeEnabled: true, pixelEnabled: true}
in syncOptions, all will prefer to respond with iframe syncs, and as a result all syncs except for someBidder will be blocked.
Test page and test results
I have prepared tests based on Prebid 9.26.0, with two bidders (Appnexus & sspBC) and different permission combinations.
Test 1: Both bidders only have image sync permissions
Url: https://bdr.wpcdn.pl/tests/usersyncs/sspbc-6.10-image_sync.html
Result: Both return image sync urls, both syncs are fired
Test 2: Both bidders have image and iframe sync permissions
Url: https://bdr.wpcdn.pl/tests/usersyncs/sspbc-6.10-iframe_sync.html
Result: Both return iframe sync urls, both syncs are fired
Test 3: Both bidders have image sync permission, but only sspBC has iframe sync permission
Url: https://bdr.wpcdn.pl/tests/usersyncs/sspbc-6.10-mixed_sync_1.html
Result: Both return iframe sync urls, sspBC sync is fired, Appnexus sync is blocked
Test 4: Both bidders have image sync permission, but only Appnexus has iframe sync permission
Url: https://bdr.wpcdn.pl/tests/usersyncs/sspbc-6.10-mixed_sync_2.html
Result: Both return iframe sync urls, Appnexus sync is fired, sspBC sync is blocked
The behavior in Test3 and Test4 is, of course, undesirable. Both bidders have image sync URLs, and could respond with them. They, however, respond with iframe sync since in both cases, regardless of actual permissions, bidders always receive
{iframeEnabled: true, pixelEnabled: true}
in syncOptionsAnd that is because syncOptions do not check for per-bidder rules - only if iframe / image / all fields are present
(see https://github.com/prebid/Prebid.js/blob/master/src/adapters/bidderFactory.js)
let syncs = spec.getUserSyncs({ iframeEnabled: !!(filterConfig && (filterConfig.iframe || filterConfig.all)), pixelEnabled: !!(filterConfig && (filterConfig.image || filterConfig.all)), }, responses, gdprConsent, uspConsent, gppConsent);
(and, for that matter, there is no recognition of include/exclude rules)
Proposed change
Sync options should be constructed with respect to the bidder (spec.code).
For a very simple example, see https://github.com/grupawp/Prebid.js/blob/fix-registerSyncInner/src/adapters/bidderFactory.js
Againm, this at the moment does not discern between include/exclude rules, but I've added method bidderHasPermission that will check if there is a permission for a specific bidder (or for '*' wildcard).
With such modification, we can look at the last test example:
Test 5: Both bidders have image sync permission, but only Appnexus has iframe sync permission. Modified registerSyncInner method
Url: https://bdr.wpcdn.pl/tests/usersyncs/sspbc-6.10-mixed_sync_3.html
Result: Appnexus returns iframe sync, sspBC returns image sync. Both syncs are fired
And this is a correct behavior, that will enable both bidders to sync users, and respect rules set by the publisher.
The text was updated successfully, but these errors were encountered: