-
Notifications
You must be signed in to change notification settings - Fork 801
Adding Events support in bid responses #1597
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
Conversation
04f7d0c
to
1849877
Compare
cfc30bc
to
b829081
Compare
…id.events Missing timestamp (waiting for prebid#1584)
- wurl insertion in cached bids - vast modifying in video bids
This avoids unnecessary conversions between json and string ok github.com/prebid/prebid-server/endpoints/events 0.034s coverage: 96.1% of statements
Rebased after #1532 |
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.
I didn't review the tests in detail yet. Have some other comments first.
openrtb_ext/request.go
Outdated
@@ -23,6 +23,7 @@ type ExtRequestPrebid struct { | |||
SChains []*ExtRequestPrebidSChain `json:"schains,omitempty"` | |||
StoredRequest *ExtStoredRequest `json:"storedrequest,omitempty"` | |||
Targeting *ExtRequestTargeting `json:"targeting,omitempty"` | |||
Events json.RawMessage `json:"events,omitempty"` |
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.
Can this be a strongly typed struct instead?
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.
It can, but it would be an empty struct, as the only possible value so far is events: {}
.
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.
Ah. Is this like caching where the presence is the trigger?
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.
ext.prebid.cache
needs a value though (vastxml
and/or bids
).
I expect that in time, so will ext.prebid.events
, but for now it works as you said.
@@ -52,11 +52,13 @@ type IdFetcher interface { | |||
|
|||
type exchange struct { | |||
adapterMap map[openrtb_ext.BidderName]adaptedBidder | |||
bidderInfo adapters.BidderInfos |
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.
Do we really need the whole info, or perhaps just a boolean lookup for if vast is enabled for the bidders?
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.
I thought to keep it generic, so if we add per-channel settings later, or need to look up other bidder settings, we would not need to go back and modify the exchange
struct and all the unit tests.
Performance-wise, it looks equivalent, only one map lookup is done either way to reach the value.
Let me know your thoughts.
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.
I wasn't worried about performance. Thought it might be simpler to only pass the information needed. I feel 50/50 on it. I imagine we'll refactor the bidderInfo map to some kind of bidderInfoService in the future anyway. I think we might need more context after I add in hardcoded aliases.
- Fixed comments - Removed redundant types in func proto - Add bool parameter to `ModifyVastXmlString()` to indicate string was changed - Decode RawMessage instead of casting to string (to handle encoded escapes) > ok github.com/prebid/prebid-server/endpoints/events 0.039s coverage: 97.4% of statements
When the VAST is modified to insert the event tracking tag, the modified creative is also returned in the bid response, in addition to being cached. Behavior currently implemented requires targeting enabled. Also renamed eventsData->eventTracking
I implemented part of the spec change mentioned here #1015 (comment) - the modified VAST creative should be returned in bid response, not only cache. I moved the VAST rewriting from auction/doCache to exchange/HoldAuction with the associated unit test migration, as they use two different sets of json specs. There are still some unanswered questions regarding the requirement that targeting be enabled for VAST rewriting because only the winning bids are modified, or even if we should modify all the bids instead. For now, this implementation requires targeting, until the requirements are clarified. This should be ok if most requests use GAM or some other network that needs the targeting keys anyway, so targeting would be enabled. Also an open question regarding the PBS behavior of making up a VAST creative from the |
- all bids have vast modified if account and bidder enabled, not just winning - all NON-VIDEO bids have events if account or request enabled - all cached NON-VIDEO bids have wurl patched in if account or request enabled. prebid#1015 (comment)
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.
LGTM
Implemented wurl insertion in cached bids, vast rewriting and bid.ext.prebid.events for #1015
Updated and refactored auction_test unit tests for cached bids
Updated exchange_test for bid.ext.prebid.events and vast rewriting
Test coverage
PG is deferred to later PR (PBS-Java does not implement it either)
CC @bretg