diff --git a/exchange/events.go b/exchange/events.go index 36b6e845bf0..e6eef23f149 100644 --- a/exchange/events.go +++ b/exchange/events.go @@ -53,7 +53,7 @@ func (ev *eventTracking) modifyBidsForEvents(seatBids map[openrtb_ext.BidderName // isModifyingVASTXMLAllowed returns true if this bidder config allows modifying VAST XML for event tracking func (ev *eventTracking) isModifyingVASTXMLAllowed(bidderName string) bool { - return ev.bidderInfos[bidderName].ModifyingVastXmlAllowed && ev.enabledForAccount + return ev.bidderInfos[bidderName].ModifyingVastXmlAllowed && (ev.enabledForAccount || ev.enabledForRequest) } // modifyBidVAST injects event Impression url if needed, otherwise returns original VAST string diff --git a/exchange/exchangetest/events-vast-account-off.json b/exchange/exchangetest/events-vast-account-off-request-off.json similarity index 100% rename from exchange/exchangetest/events-vast-account-off.json rename to exchange/exchangetest/events-vast-account-off-request-off.json diff --git a/exchange/exchangetest/events-vast-account-off-request-on.json b/exchange/exchangetest/events-vast-account-off-request-on.json new file mode 100644 index 00000000000..81aab056d72 --- /dev/null +++ b/exchange/exchangetest/events-vast-account-off-request-on.json @@ -0,0 +1,163 @@ +{ + "events_enabled": false, + "start_time_ms": 1234567890, + "incomingRequest": { + "ortbRequest": { + "id": "some-request-id", + "app": { + "id": "some-app" + }, + "imp": [ + { + "id": "my-imp-id", + "video": {}, + "ext": { + "appnexus": { + "placementId": 1 + }, + "audienceNetwork": { + "placementId": 1 + } + } + } + ], + "ext": { + "prebid": { + "targeting": { + "includewinners": true, + "includebidderkeys": false + }, + "events": {} + } + } + } + }, + "outgoingRequests": { + "appnexus": { + "modifyingVastXmlAllowed": true, + "mockResponse": { + "pbsSeatBid": { + "pbsBids": [ + { + "ortbBid": { + "id": "winning-bid", + "nurl": "http://domain.com/winning-bid", + "impid": "my-imp-id", + "price": 0.71, + "w": 200, + "h": 250, + "crid": "creative-1" + }, + "bidType": "video" + }, + { + "ortbBid": { + "id": "losing-bid", + "nurl": "http://domain.com/losing-bid", + "impid": "my-imp-id", + "price": 0.21, + "w": 200, + "h": 250, + "crid": "creative-2" + }, + "bidType": "video" + } + ] + } + } + }, + "audienceNetwork": { + "modifyingVastXmlAllowed": false, + "mockResponse": { + "pbsSeatBid": { + "pbsBids": [ + { + "ortbBid": { + "id": "contending-bid", + "nurl": "http://domain.com/contending-bid", + "impid": "my-imp-id", + "price": 0.51, + "w": 200, + "h": 250, + "crid": "creative-4" + }, + "bidType": "video" + } + ] + } + } + } + }, + "response": { + "bids": { + "id": "some-request-id", + "seatbid": [ + { + "seat": "audienceNetwork", + "bid": [ + { + "id": "contending-bid", + "nurl": "http://domain.com/contending-bid", + "impid": "my-imp-id", + "price": 0.51, + "w": 200, + "h": 250, + "crid": "creative-4", + "ext": { + "prebid": { + "type": "video" + } + } + } + ] + }, + { + "seat": "appnexus", + "bid": [ + { + "id": "winning-bid", + "adm": "prebid.org wrapper", + "nurl": "http://domain.com/winning-bid", + "impid": "my-imp-id", + "price": 0.71, + "w": 200, + "h": 250, + "crid": "creative-1", + "ext": { + "prebid": { + "type": "video", + "targeting": { + "hb_bidder": "appnexus", + "hb_cache_host": "www.pbcserver.com", + "hb_cache_path": "/pbcache/endpoint", + "hb_env": "mobile-app", + "hb_pb": "0.70", + "hb_size": "200x250" + } + } + } + }, + { + "id": "losing-bid", + "adm": "prebid.org wrapper", + "nurl": "http://domain.com/losing-bid", + "impid": "my-imp-id", + "price": 0.21, + "w": 200, + "h": 250, + "crid": "creative-2", + "ext": { + "prebid": { + "type": "video" + } + } + } + ] + } + ] + }, + "prebid": { + "auctiontimestamp": 1234567890 + } + } +} \ No newline at end of file diff --git a/exchange/exchangetest/events-vast-account-on.json b/exchange/exchangetest/events-vast-account-on-request-off.json similarity index 100% rename from exchange/exchangetest/events-vast-account-on.json rename to exchange/exchangetest/events-vast-account-on-request-off.json