Skip to content
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

Exitpoint Stage Documentation #5739

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/images/prebid-server/module-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions prebid-server/developers/add-a-module-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ These are the available hooks that can be implemented in a module:
- org.prebid.server.hooks.v1.bidder.RawBidderResponseHook
- org.prebid.server.hooks.v1.bidder.AllProcessedBidResponsesHook
- org.prebid.server.hooks.v1.auction.AuctionResponseHook
- org.prebid.server.hooks.v1.exitpoint.ExitpointHook

In a module it is not necessary to implement all mentioned interfaces but only one (or several) required by your functionality.

Expand All @@ -131,6 +132,18 @@ Each hook interface internally extends org.prebid.server.hooks.v1.Hook basic int
- `code()` - returns module code.
- `call(...)` - returns result of hook invocation.

### Difference between AuctionResponseHook and ExitpointHook
In the nutshell both hooks allow to modify the OpenRTB Bid Response but in the different formats.
The AuctionResponseHook provides the last chance to work with the Java objects that allow to modify the auction response with ease.
The ExitpointHook allows to build a completely different response based on the received auction context. It's possible but not recommended to modify the auction/amp/video response on that stage, rather build another one and modify response headers accordingly.

Important Notes:

- the ExitpointHook is a powerful tool that allows to re-write the auction results, so make sure the important data won't be lost for the client.
- since the response body is already prepared before and is not modified after calling the ExitpointHook
the results of its execution, i.e. debug info, traces, won't be added automatically, but can be added manually inside the hook.
- analytics adapters doesn't have access to the response built by the ExitpointHook, but they receive the up-to-date auction context with the ExitpointHook execution status and analytics tags.

### Examples

1. To **update** the request in the `RawAuctionRequestHook` you would return:
Expand Down
3 changes: 2 additions & 1 deletion prebid-server/developers/add-a-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Here's a description of the Stages of a PBS request that modules can tap into fo
| Bidder Request | The request has been customized for a particular bidder in the auction. Note that the module will be called in parallel for each bidder in the auction. | auction, amp, video | Bidder-specific bcat/badv, Bidder-specific deals |
| Raw Bidder Response | Hook functions can get access to the unprocessed bidder response. Note that the module will be called in parallel for each bidder in the auction. | auction, amp, video | Response validations |
| All Processed Bid Responses | All bids are back and PBS-core bid validations are done. | auction, amp, video | Creative validation, advanced bid validations. |
| Auction Response | Last step before the response goes back to the client | auction, amp, video | Inject ad server targeting, alternate auction winner logic |
| Auction Response | Last chance to modify the bid auction response | auction, amp, video | Inject ad server targeting, alternate auction winner logic |
| Exitpoint | Last step before the response goes back to the client. Allows to modify the response headers and body | auction, amp, video | ??? |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bretg Could you assist on providing use cases for the exitpoint stage? Thanks


### 3. Figure Out Which Stages You're Going to Hook Into

Expand Down