-
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
New debugging functionality with bid overrides #2492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTO
Need a section in http://prebid.org/dev-docs/toubleshooting-tips.html with an example of how to use this. I assume that the pbjs.setconfig() calls are meant to be called from the console, right? Not practical in the page. |
@bretg that's right, you would use pbjs.setConfig from the console to enable/disable your debugging session (which can stick around across page-loads until you disable) |
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. |
} | ||
} | ||
|
||
export function addBidResponseHook(overrides, adUnitCode, bid, next) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting the hook here has the disadvantage of not actually suppressing the network call for the bidder. I think it's ok given that it's probably more complex to turn off the bidder completely. We probably just want to point that out it's not a great option to "disable a bidder".
src/debugging.js
Outdated
if (!debugging.enabled) { | ||
disableOverrides(); | ||
try { | ||
sessionStorage.removeItem(OVERRIDE_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you change this to window.sessionStorage
?
LGTM. Nice feature! one small comment. |
* new debugging functionality with bid overrides * update name from bidderOverrides to debugging * change sessionStorage to window.sessionStorage
This reverts commit 48bd7b8.
* new debugging functionality with bid overrides * update name from bidderOverrides to debugging * change sessionStorage to window.sessionStorage
This reverts commit 48bd7b8.
* new debugging functionality with bid overrides * update name from bidderOverrides to debugging * change sessionStorage to window.sessionStorage
This reverts commit 48bd7b8.
Type of change
Description of change
This feature adds the ability to override bid responses as they come in or to filter bidders for debugging purposes. The debugging features, when enabled, will stay active for the duration of your session (until you close active tab) or until they are disabled with
pbjs.setConfig
.Filtering bidders:
Overwriting bid responses for all bidders:
Overwriting bid responses for a specific bidder and adUnit code (can use separately)
Disabling debugging
Other information
Original description: https://gist.github.com/bretg/4880f9977a2e49e8a194b701b2e95b67
Using
pbjs.setConfig
andsessionStorage
rather than url strings as encoding JSON for use in URLs is a cumbersome process.