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

Losing Bid Ad Ids #860

Closed
AskRupert-DM opened this issue Mar 28, 2019 · 27 comments
Closed

Losing Bid Ad Ids #860

AskRupert-DM opened this issue Mar 28, 2019 · 27 comments

Comments

@AskRupert-DM
Copy link

Hi

I had a question regarding prebid server bid responses for all bids. Right now it seems as though only an adID for the winning bid is returned in the end bid response.

I'm able to respond back with all bids & am able to send back all the common key-values in terms of the bidders name and their price bids - but don't have the respective ad IDs for the non-winning/losing bids.

Some publishers are setup in a way where they let the ad-server DFP do decisioning on which bid to pick based on the hb_pb_ssp key-value and therefore require the adid for the respective bid in order to correctly render it - however, it looks like by design PBS is only providing an ad ID for the winning bid and none of the other bids that were made ?

Any ideas on how what changes need to be made in PBS to potentially allow for publishers to pick/select one of the non-winning bids adIDs to render/run ?

Cheers,
Rupesh

@hhhjort
Copy link
Collaborator

hhhjort commented Mar 28, 2019

Actually reviewing the targeting keys, we never send back the bid ID, not even for the winning bid. There are two ways for a creative to pull the correct ad to display. For the default winning bid only setup, the creative can ask prebid.js for the winning bid without knowing the bid ID. If the publisher has set up per bidder line items, then the creative can know which bidder it represents and can query the bids for the wining bid from its bidder. Or you can turn on caching and pull the correct bid (or VAST xml) from cache if the creative cannot access the PBS response at all. (AMP delivery relies on this.)

@AskRupert-DM
Copy link
Author

Thanks for the reply @hhhjort - so its not the bid_id I am referring too here but the respective SSP 'adid' key.

With Prebid clientSide - if you enable sendAllBids - you get back the following keys for each SSP that has bid (below is an example for the openX bidder):

hb_format_openx=banner
hb_source_openx=client
hb_size_openx=970x250
hb_pb_openx=0.20
hb_adid_openx=430d5d5459bcfec
hb_bidder_openx=openx

so each bid that was received - has a hb_adid_[SSP-NAME] key returned for it - is it possible to do the same for all SSP bids that are returned on PBS - as I expose all bids to the client from PBS - the only key am missing is the ad_id (am able to return price and bidder name so would assume there would be a way to select a non-winning bid via the client) ?

The publishers target line items using various price increments against the 'hb_pb_[SSP NAME]' key they have setup in DFP & then have their DFP creative using/referencing the corresponding adid key:

<script> try{ window.top.pbjs.renderAd(document, '%%PATTERN:hb_adid_openx%%'); } catch(e) {/*ignore*/} </script>

Aware this is an older creative template but want to know if its possible to achieve the same with PBS / how a bid from a particular SSP can be selected even if its not necessarily the highest/winning one ?

@hhhjort
Copy link
Collaborator

hhhjort commented Mar 28, 2019

It would require a code change to enable sending hb_adid and hb_adid_<bidder>, shouldn't be too difficult. But not possible to configure with the current code as it is.

@AskRupert-DM
Copy link
Author

Thanks - where/what code would change - can you advise or point me in the right direction and I'll pick up with my engineers ...

@hhhjort
Copy link
Collaborator

hhhjort commented Mar 28, 2019

look at /exchange/targeting.go:setTargeting()

@hhhjort
Copy link
Collaborator

hhhjort commented Mar 28, 2019

Oh, one other thing to be aware of if you are using prebid.js ... prebid.js does not request targeting parameters from Prebid Server, it just generates its own set of targeting key-values after reading the bid response from PBS. So if that is your use case, you want to look at the prebid.js code rather than the prebid server code.

@bretg
Copy link
Contributor

bretg commented Mar 28, 2019

@AskRupert-DM - what's your client platform -- is it Prebid.js or SDK?

Prebid.js should be generating the hb_adid targeting value, not PBS. PBS should send back the whole creative body for each bidder, which is then cached, assigned an ID, and ready for pbjs.renderAd.

SDK is different - it can be set up to send the whole creative and do app-side caching, in which case it does need an hb_adid, but that could (should?) be provided by the SDK. Or it can be set up with server-side caching in which case hb_cache_id is how the creative is retrieved.

@AskRupert-DM
Copy link
Author

AskRupert-DM commented Mar 28, 2019

client - prebid.js @bretg - I can provide you a sample of the response I get back from PBS for a given impression if that helps but in short - only the winning / highest bid has an adID in the body.

@hhhjort
Copy link
Collaborator

hhhjort commented Mar 28, 2019

That would be interesting as "hb_adid" does not appear anywhere in the PBS code that I can find. Please include the sample request that generated your sample response.

@AskRupert-DM
Copy link
Author

Sample request:

curl 'https://elb.the-ozone-project.com/openrtb2/auction' -H 'Referer: http://ozone.tpdads.com/adapter/1.4.5/test-single.html?pbjs_debug=true' -H 'Origin: http://ozone.tpdads.com' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36' -H 'Content-Type: text/plain' --data-binary '{"regs":{"ext":{"gdpr":1}},"user":{"ext":{"consent":""}},"device":{"w":1420,"h":739},"site":{"publisher":{"id":"OZONENUK0001"},"page":"http://ozone.tpdads.com/adapter/1.4.5/test-single.html?pbjs_debug=true"},"test":1,"id":"41c4bd53-8263-45af-ae4b-e2aa5bfc2623","auctionId":"41c4bd53-8263-45af-ae4b-e2aa5bfc2623","imp":[{"id":"75366327384845","tagid":"0420420421","secure":0,"banner":{"topframe":1,"w":300,"h":250,"format":[{"w":300,"h":250},{"w":300,"h":600}]},"placementId":"0420420421","publisherId":"OZONENUK0001","siteId":"4204204201","ext":{"prebid":{"storedrequest":{"id":"0420420421"}},"ozone":{"adUnitCode":"mpu","transactionId":"f20ae4e1-e391-4216-9e8b-95843792aeb4","customData":{"sens":"f","pt1":"/uk","pt2":"uk","pt3":"network-front","pt4":"ng","pt5":["uk"],"pt7":"wide"},"ozoneData":{"age":"group2"},"lotameData":{"Profile":{"tpid":"4e5c21fc7c181c2b1eb3a73d543a27f6","pid":"3a45fd4872fa01f35c49586d8dcb7c60","Audience":[{"id":"439847","abbr":"all"},{"id":"446197","abbr":"Arts, Culture & Literature"},{"id":"446198","abbr":"Business"}]}},"pubcid":"2d0789fa-2815-4e9a-8310-02323e697bce"}}},{"id":"8ea269ab849ce8","tagid":"0420420421","secure":0,"banner":{"topframe":1,"w":728,"h":90,"format":[{"w":728,"h":90},{"w":970,"h":250}]},"placementId":"0420420421","publisherId":"OZONENUK0001","siteId":"4204204201","ext":{"prebid":{"storedrequest":{"id":"0420420421"}},"ozone":{"adUnitCode":"leaderboard","transactionId":"c7abf2a4-fde5-415f-aded-6f003ab31946","customData":{"sens":"f","pt1":"/uk","pt2":"uk","pt3":"network-front","pt4":"ng","pt5":["uk"],"pt7":"wide"},"ozoneData":{"age":"group2"},"lotameData":{"Profile":{"tpid":"4e5c21fc7c181c2b1eb3a73d543a27f6","pid":"3a45fd4872fa01f35c49586d8dcb7c60","Audience":[{"id":"439847","abbr":"all"},{"id":"446197","abbr":"Arts, Culture & Literature"},{"id":"446198","abbr":"Business"}]}},"pubcid":"2d0789fa-2815-4e9a-8310-02323e697bce"}}}],"source":{"tid":"41c4bd53-8263-45af-ae4b-e2aa5bfc2623"}}' --compressed

Respective Response:

{ "id": "41c4bd53-8263-45af-ae4b-e2aa5bfc2623", "seatbid": [ { "bid": [ { "id": "2430788685808986785", "impid": "75366327384845", "price": 0.26407, "adm": "<script src=\"http:\/\/ams1-ib.adnxs.com\/ab?test=1&referrer=http%3A%2F%2Fozone.tpdads.com%2Fadapter%2F1.4.5%2Ftest-single.html%3Fpbjs_debug%3Dtrue&e=wqT_3QLICGxIBAAAAwDWAAUBCKSK9OQFEK7imLirxbSCbBj_EQEwASo2CbuzdtuF5tA_EREJJBkAAAAgrkfRPyEREgApEQkAMREbqDDc-OgGOPtNQPtNSAJQ_vOIOVjf9GhgAGi60IIBeIWQBYABAYoBA1VTRJIFBvBvmAGsAqAB-gGoAQGwAQC4AQLAAQTIAQLQAQDYAQDgAQHwAQCKAlh1ZignYScsIDI4OTU5NDAsIDE1NTM3OTQzNDApO3VmKCdyJywgMTE5NjgzNTgyLCAxNTUzNzk0MzQwKTt1ZignaScsIDk1MTQ5MDY7APCBkgKVAiFmVWlLNXdqOTNaTU1FUDd6aURrWUFDRGY5R2d3QURnQVFBUkktMDFRM1Bqb0JsZ0FZUF9fX184UGFBQndBWGdCZ0FFQmlBRUJrQUVCbUFFQm9BRUJxQUVCc0FFQXVRRjFxdzFzbXBuSlA4RUItVDVCbjQzbTBEX0pBUUFBQQEDmFBBXzJRR3hGcDhDWUR6b1AtQUJ3b2s2OVFITnpFdy1tQUlBb0FMXwF2DEQ3VUMBMwhBTDAJCPBgTUFDQWNnQ0FkQUNBZGdDQWVBQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEX2QyVERMb0RDVUZOVXpFNk16azFNLUFEb0FtQUJPaWsxQUdJQkliejFBR1FCQUEumgJhIUhSU21oUTYYATQzX1JvSUFRb0FER2FtWgECkG5KUHpvSlFVMVRNVG96T1RVelFLQUpTYkVXbndKZ1BPZ19VUUEFswEBAFcdDPBs2AIA4AKyrkzqAkZodHRwOi8vb3pvbmUudHBkYWRzLmNvbS9hZGFwdGVyLzEuNC41L3Rlc3Qtc2luZ2xlLmh0bWw_cGJqc19kZWJ1Zz10cnVl8gITCg9DVVNUT01fTU9ERUxfSUQSAPICGgoWQy4WAEBMRUFGX05BTUUSAPICHgoaQzIdAPCZQVNUX01PRElGSUVEEgCAAwGIAwGQAwCYAxSgAwGqAwDAA6wCyAMA2AMA4AMA6AMA-AMDgAQAkgQJL29wZW5ydGIymAQAogQMODEuMTUwLjAuMTExqATquwqyBAwIABAAGAAgADAAOAC4BADABADIBADSBA45OTc5I0FNUzE6Mzk1M9oEAggB4AQA8AT-84g5iAUBmAUAoAX__22duAGqBSQ0MWM0YmQ1My04MjYzLTQ1YWYtYWU0Yi1lMmFhNWJmYzI2MjPABQDJBQAAAQIU8D_SBQkJAQoBAWjYBQHgBQHwBQH6BQQIABAAkAYAmAYAuAYBwQYBHywAAPA_yAYA2gYWChAJEBkBLBAAGADgBgHyBgIIAA..&s=e3f88de0864df498ba895c57237cf01ed2362648&pp=${AUCTION_PRICE}\"><\/script><div id='ozone_win'><img src='\/\/elb.the-ozone-project.com\/wp.gif?currency=USD&seat_name=appnexus&seat_id=9979&request_id=41c4bd53-8263-45af-ae4b-e2aa5bfc2623&adunit=75366327384845&size=300x250&adomain=%5B%22appnexus.com%22%5D&imp_id=75366327384845&auction_id=7783577136904155438&bid_id=2430788685808986785&crid=119683582&price=0.26407'> height='0' width='0' border='0'<\/div>", "adid": "119683582", "adomain": [ "appnexus.com" ], "iurl": "http:\/\/ams1-ib.adnxs.com\/cr?id=119683582", "cid": "9979", "crid": "119683582", "w": 300, "h": 250, "ext": { "prebid": { "type": "banner" }, "bidder": { "appnexus": { "brand_id": 1, "auction_id": 7.7835771369042e+18, "bidder_id": 2, "bid_ad_type": 0 } } } }, { "id": "6750124049297388838", "impid": "8ea269ab849ce8", "price": 0.26407, "adm": "<script src=\"http:\/\/ams1-ib.adnxs.com\/ab?test=1&referrer=http%3A%2F%2Fozone.tpdads.com%2Fadapter%2F1.4.5%2Ftest-single.html%3Fpbjs_debug%3Dtrue&e=wqT_3QLHCGxHBAAAAwDWAAUBCKSK9OQFEO37gaitpbCVVRj_EQEwASo2CbuzdtuF5tA_EREJJBkAAAAgrkfRPyEREgApEQkAMREbqDDc-OgGOPtNQPtNSAJQ5ZmnOVjf9GhgAGi60IIBeIWQBYABAYoBA1VTRJIFBvBgmAHYBaABWqgBAbABALgBAsABBMgBAtABANgBAOABAfABAIoCWHVmKCdhJywgMjg5NTk0MCwgMTU1Mzc5NDM0MCk7dWYoJ3InLCAxMjAxNzk5NDEsIDE1NTM3OTQzNDApOwE8IGknLCA5NTE0OTo7APCBkgKVAiFFVWg3bndqcnhiVU1FT1dacHprWUFDRGY5R2d3QURnQVFBUkktMDFRM1Bqb0JsZ0FZUF9fX184UGFBQndBWGdCZ0FFQmlBRUJrQUVCbUFFQm9BRUJxQUVCc0FFQXVRRjFxdzFzbXBuSlA4RUItVDVCbjQzbTBEX0pBUUFBQQEDmFBBXzJRR3hGcDhDWUR6b1AtQUJ3b2s2OVFITnpFdy1tQUlBb0FMXwF2DEQ3VUMBMwhBTDAJCPBgTUFDQWNnQ0FkQUNBZGdDQWVBQ0FPZ0NBUGdDQUlBREFaZ0RBYWdENjhXMURMb0RDVUZOVXpFNk16azFNLUFEb0FtQUJPaWsxQUdJQkpyUTJ3R1FCQUEumgJhIXdSTW1idzYYATQzX1JvSUFRb0FER2FtWgECkG5KUHpvSlFVMVRNVG96T1RVelFLQUpTYkVXbndKZ1BPZ19VUUEFswEBAFcdDPBs2AIA4AKyrkzqAkZodHRwOi8vb3pvbmUudHBkYWRzLmNvbS9hZGFwdGVyLzEuNC41L3Rlc3Qtc2luZ2xlLmh0bWw_cGJqc19kZWJ1Zz10cnVl8gITCg9DVVNUT01fTU9ERUxfSUQSAPICGgoWQy4WAEBMRUFGX05BTUUSAPICHgoaQzIdAPCZQVNUX01PRElGSUVEEgCAAwGIAwGQAwCYAxSgAwGqAwDAA6wCyAMA2AMA4AMA6AMA-AMDgAQAkgQJL29wZW5ydGIymAQAogQMODEuMTUwLjAuMTExqATquwqyBAwIABAAGAAgADAAOAC4BADABADIBADSBA45OTc5I0FNUzE6Mzk1M9oEAggB4AQA8ATlmac5iAUBmAUAoAX__22cuAGqBSQ0MWM0YmQ1My04MjYzLTQ1YWYtYWU0Yi1lMmFhNWJmYzI2MjPABQDJBQAAAQIU8D_SBQkJAQoBAWjYBQHgBQHwBQH6BQQIABAAkAYAmAYAuAYBwQYBHywAAPA_yAYA2gYWChAJEBkBLBAAGADgBgHyBgIIAA..&s=43d30a0b51798165be3cec75879f87fbb6989baf&pp=${AUCTION_PRICE}\"><\/script><div id='ozone_win'><img src='\/\/elb.the-ozone-project.com\/wp.gif?currency=USD&seat_name=appnexus&seat_id=9979&request_id=41c4bd53-8263-45af-ae4b-e2aa5bfc2623&adunit=8ea269ab849ce8&size=728x90&adomain=%5B%22appnexus.com%22%5D&imp_id=8ea269ab849ce8&auction_id=6136929831952088557&bid_id=6750124049297388838&crid=120179941&price=0.26407'> height='0' width='0' border='0'<\/div>", "adid": "120179941", "adomain": [ "appnexus.com" ], "iurl": "http:\/\/ams1-ib.adnxs.com\/cr?id=120179941", "cid": "9979", "crid": "120179941", "w": 728, "h": 90, "ext": { "prebid": { "type": "banner" }, "bidder": { "appnexus": { "brand_id": 1, "auction_id": 6.1369298319521e+18, "bidder_id": 2, "bid_ad_type": 0 } } } } ], "seat": "appnexus" }, { "bid": [ { "id": "bfe21508-5e72-4b4d-b469-f7831f8614b9", "impid": "75366327384845", "price": 0.01, "adm": "<div id='beacon_24281' style='position:absolute;left:0px;top:0px;visibility:hidden;'><img src='https:\/\/rtb-xa.openx.net\/win\/prebid?p=FIRST&t=2DAABBgABAAECAAIBAAsAAgAAAJkcGAp6ZUUxcTBxVmlPHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbl0u2Y9L31nYABFo2tz4ecn4SWlwEAFsSU6MkLFQYALBwVAgAcFQIAABwm7vmYgwQVBBUEJur5mIMEFtzgnoAE1hQAHCbEqp-ABBay1bWABBb8w7aDBBag9N2ABBUCHBT0AxTYBAAVBBUKFhQmFEUKAAAA&ph=a3aece0c-9e80-4316-8deb-faf804779bd1'\/><\/div><a href='http:\/\/sademo-d.openx.net\/w\/1.0\/rc?ts=2DAABBgABAAECAAIBAAsAAgAAAJkcGAp6ZUUxcTBxVmlPHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbl0u2Y9L31nYABFo2tz4ecn4SWlwEAFsSU6MkLFQYALBwVAgAcFQIAABwm7vmYgwQVBBUEJur5mIMEFtzgnoAE1hQAHCbEqp-ABBay1bWABBb8w7aDBBag9N2ABBUCHBT0AxTYBAAVBBUKFhQmFEUKAAAA' target='_blank'>\n <img src='http:\/\/ox-i.sademo.servedbyopenx.com\/a3a\/a3aece0c-9e80-4316-8deb-faf804779bd1\/80e\/80eeedd896f54edfa01c82fdb6a372b7.jpg' height='250' width='300' border='0' alt=''\/>\n<\/a>\n<div id='beacon_24021' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'>\n <img src='http:\/\/sademo-d.openx.net\/w\/1.0\/rr?ts=2DAABBgABAAECAAIBAAsAAgAAAJkcGAp6ZUUxcTBxVmlPHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbl0u2Y9L31nYABFo2tz4ecn4SWlwEAFsSU6MkLFQYALBwVAgAcFQIAABwm7vmYgwQVBBUEJur5mIMEFtzgnoAE1hQAHCbEqp-ABBay1bWABBb8w7aDBBag9N2ABBUCHBT0AxTYBAAVBBUKFhQmFEUKAAAA'\/>\n<\/div>\n<iframe src='https:\/\/us-u.openx.net\/w\/1.0\/pd?plm=6&ph=a3aece0c-9e80-4316-8deb-faf804779bd1&gdpr=1&gdpr_consent=' width='0' height='0' style='display:none;'><\/iframe><div id='ozone_win'><img src='\/\/elb.the-ozone-project.com\/wp.gif?currency=USD&seat_name=openx&request_id=41c4bd53-8263-45af-ae4b-e2aa5bfc2623&adunit=75366327384845&size=300x250&adomain=&imp_id=75366327384845&bid_id=bfe21508-5e72-4b4d-b469-f7831f8614b9&crid=540463358&price=0.01'> height='0' width='0' border='0'<\/div>", "crid": "540463358", "w": 300, "h": 250, "ext": { "prebid": { "type": "banner" } } }, { "id": "d317294c-b76a-4f5b-96b4-d746bddb2fc6", "impid": "8ea269ab849ce8", "price": 0.01, "adm": "<div id='beacon_24294' style='position:absolute;left:0px;top:0px;visibility:hidden;'><img src='https:\/\/rtb-xa.openx.net\/win\/prebid?p=FIRST&t=2DAABBgABAAECAAIBAAsAAgAAAJgcGApXTENWUVU3UktsHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbJwq2J6azr6FkW88CmoqiulMvSAQAWxJToyQsVBgAsHBUCABwVAgAAHCbu-ZiDBBUEFQQm6vmYgwQW3OCegATWFAAcJsSqn4AEFrLVtYAEFurRmoEEFqD03YAEFQIcFLQBFLALABUEFQoWFCYURQoAAAA&ph=a3aece0c-9e80-4316-8deb-faf804779bd1'\/><\/div><a href='http:\/\/sademo-d.openx.net\/w\/1.0\/rc?ts=2DAABBgABAAECAAIBAAsAAgAAAJgcGApXTENWUVU3UktsHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbJwq2J6azr6FkW88CmoqiulMvSAQAWxJToyQsVBgAsHBUCABwVAgAAHCbu-ZiDBBUEFQQm6vmYgwQW3OCegATWFAAcJsSqn4AEFrLVtYAEFurRmoEEFqD03YAEFQIcFLQBFLALABUEFQoWFCYURQoAAAA' target='_blank'>\n <img src='http:\/\/ox-i.sademo.servedbyopenx.com\/a3a\/a3aece0c-9e80-4316-8deb-faf804779bd1\/0c8\/0c8dd68f50234093bc08b7339ee0093d.jpg' height='90' width='728' border='0' alt=''\/>\n<\/a>\n<div id='beacon_24168' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'>\n <img src='http:\/\/sademo-d.openx.net\/w\/1.0\/rr?ts=2DAABBgABAAECAAIBAAsAAgAAAJgcGApXTENWUVU3UktsHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbJwq2J6azr6FkW88CmoqiulMvSAQAWxJToyQsVBgAsHBUCABwVAgAAHCbu-ZiDBBUEFQQm6vmYgwQW3OCegATWFAAcJsSqn4AEFrLVtYAEFurRmoEEFqD03YAEFQIcFLQBFLALABUEFQoWFCYURQoAAAA'\/>\n<\/div>\n<iframe src='https:\/\/us-u.openx.net\/w\/1.0\/pd?plm=6&ph=a3aece0c-9e80-4316-8deb-faf804779bd1&gdpr=1&gdpr_consent=' width='0' height='0' style='display:none;'><\/iframe><div id='ozone_win'><img src='\/\/elb.the-ozone-project.com\/wp.gif?currency=USD&seat_name=openx&request_id=41c4bd53-8263-45af-ae4b-e2aa5bfc2623&adunit=8ea269ab849ce8&size=728x90&adomain=&imp_id=8ea269ab849ce8&bid_id=d317294c-b76a-4f5b-96b4-d746bddb2fc6&crid=538137717&price=0.01'> height='0' width='0' border='0'<\/div>", "crid": "538137717", "w": 728, "h": 90, "ext": { "prebid": { "type": "banner" } } } ], "seat": "openx" } ], "ext": { "debug": { "httpcalls": { "appnexus": [ { "uri": "http:\/\/ib.adnxs.com\/openrtb2", "requestbody": "{\"id\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\",\"imp\":[{\"id\":\"75366327384845\",\"banner\":{\"format\":[{\"w\":300,\"h\":250},{\"w\":300,\"h\":600}],\"w\":300,\"h\":250,\"topframe\":1},\"tagid\":\"0420420421\",\"secure\":0,\"ext\":{\"appnexus\":{\"placement_id\":14302300}}},{\"id\":\"8ea269ab849ce8\",\"banner\":{\"format\":[{\"w\":728,\"h\":90},{\"w\":970,\"h\":250}],\"w\":728,\"h\":90,\"topframe\":1},\"tagid\":\"0420420421\",\"secure\":0,\"ext\":{\"appnexus\":{\"placement_id\":14302300}}}],\"site\":{\"domain\":\"tpdads.com\",\"page\":\"http:\/\/ozone.tpdads.com\/adapter\/1.4.5\/test-single.html?pbjs_debug=true\",\"publisher\":{\"id\":\"OZONENUK0001\"}},\"device\":{\"ua\":\"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/73.0.3683.86 Safari\/537.36\",\"geo\":{\"country\":\"United Kingdom\",\"city\":\"Melksham\"},\"ip\":\"81.150.0.111\",\"h\":739,\"w\":1420},\"user\":{\"id\":\"ID=41b0c1627351084a:T=1542995502:S=ALNI_MaSQSy0YVymSk2GBeJpPPfUdlVKUw\",\"buyeruid\":\"5358510709346746690\",\"ext\":{\"consent\":\"\"}},\"test\":1,\"at\":1,\"source\":{\"tid\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\"},\"regs\":{\"ext\":{\"gdpr\":1}}}", "responsebody": "{\"id\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\",\"seatbid\":[{\"bid\":[{\"id\":\"2430788685808986785\",\"impid\":\"75366327384845\",\"price\":0.264070,\"adid\":\"119683582\",\"adm\":\"<script src=\\\"http:\\\/\\\/ams1-ib.adnxs.com\\\/ab?test=1&referrer=http%3A%2F%2Fozone.tpdads.com%2Fadapter%2F1.4.5%2Ftest-single.html%3Fpbjs_debug%3Dtrue&e=wqT_3QLICGxIBAAAAwDWAAUBCKSK9OQFEK7imLirxbSCbBj_EQEwASo2CbuzdtuF5tA_EREJJBkAAAAgrkfRPyEREgApEQkAMREbqDDc-OgGOPtNQPtNSAJQ_vOIOVjf9GhgAGi60IIBeIWQBYABAYoBA1VTRJIFBvBvmAGsAqAB-gGoAQGwAQC4AQLAAQTIAQLQAQDYAQDgAQHwAQCKAlh1ZignYScsIDI4OTU5NDAsIDE1NTM3OTQzNDApO3VmKCdyJywgMTE5NjgzNTgyLCAxNTUzNzk0MzQwKTt1ZignaScsIDk1MTQ5MDY7APCBkgKVAiFmVWlLNXdqOTNaTU1FUDd6aURrWUFDRGY5R2d3QURnQVFBUkktMDFRM1Bqb0JsZ0FZUF9fX184UGFBQndBWGdCZ0FFQmlBRUJrQUVCbUFFQm9BRUJxQUVCc0FFQXVRRjFxdzFzbXBuSlA4RUItVDVCbjQzbTBEX0pBUUFBQQEDmFBBXzJRR3hGcDhDWUR6b1AtQUJ3b2s2OVFITnpFdy1tQUlBb0FMXwF2DEQ3VUMBMwhBTDAJCPBgTUFDQWNnQ0FkQUNBZGdDQWVBQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEX2QyVERMb0RDVUZOVXpFNk16azFNLUFEb0FtQUJPaWsxQUdJQkliejFBR1FCQUEumgJhIUhSU21oUTYYATQzX1JvSUFRb0FER2FtWgECkG5KUHpvSlFVMVRNVG96T1RVelFLQUpTYkVXbndKZ1BPZ19VUUEFswEBAFcdDPBs2AIA4AKyrkzqAkZodHRwOi8vb3pvbmUudHBkYWRzLmNvbS9hZGFwdGVyLzEuNC41L3Rlc3Qtc2luZ2xlLmh0bWw_cGJqc19kZWJ1Zz10cnVl8gITCg9DVVNUT01fTU9ERUxfSUQSAPICGgoWQy4WAEBMRUFGX05BTUUSAPICHgoaQzIdAPCZQVNUX01PRElGSUVEEgCAAwGIAwGQAwCYAxSgAwGqAwDAA6wCyAMA2AMA4AMA6AMA-AMDgAQAkgQJL29wZW5ydGIymAQAogQMODEuMTUwLjAuMTExqATquwqyBAwIABAAGAAgADAAOAC4BADABADIBADSBA45OTc5I0FNUzE6Mzk1M9oEAggB4AQA8AT-84g5iAUBmAUAoAX__22duAGqBSQ0MWM0YmQ1My04MjYzLTQ1YWYtYWU0Yi1lMmFhNWJmYzI2MjPABQDJBQAAAQIU8D_SBQkJAQoBAWjYBQHgBQHwBQH6BQQIABAAkAYAmAYAuAYBwQYBHywAAPA_yAYA2gYWChAJEBkBLBAAGADgBgHyBgIIAA..&s=e3f88de0864df498ba895c57237cf01ed2362648&pp=${AUCTION_PRICE}\\\"><\\\/script>\",\"adomain\":[\"appnexus.com\"],\"iurl\":\"http:\\\/\\\/ams1-ib.adnxs.com\\\/cr?id=119683582\",\"cid\":\"9979\",\"crid\":\"119683582\",\"h\":250,\"w\":300,\"ext\":{\"appnexus\":{\"brand_id\":1,\"auction_id\":7783577136904155438,\"bidder_id\":2,\"bid_ad_type\":0}}}],\"seat\":\"9979\"},{\"bid\":[{\"id\":\"6750124049297388838\",\"impid\":\"8ea269ab849ce8\",\"price\":0.264070,\"adid\":\"120179941\",\"adm\":\"<script src=\\\"http:\\\/\\\/ams1-ib.adnxs.com\\\/ab?test=1&referrer=http%3A%2F%2Fozone.tpdads.com%2Fadapter%2F1.4.5%2Ftest-single.html%3Fpbjs_debug%3Dtrue&e=wqT_3QLHCGxHBAAAAwDWAAUBCKSK9OQFEO37gaitpbCVVRj_EQEwASo2CbuzdtuF5tA_EREJJBkAAAAgrkfRPyEREgApEQkAMREbqDDc-OgGOPtNQPtNSAJQ5ZmnOVjf9GhgAGi60IIBeIWQBYABAYoBA1VTRJIFBvBgmAHYBaABWqgBAbABALgBAsABBMgBAtABANgBAOABAfABAIoCWHVmKCdhJywgMjg5NTk0MCwgMTU1Mzc5NDM0MCk7dWYoJ3InLCAxMjAxNzk5NDEsIDE1NTM3OTQzNDApOwE8IGknLCA5NTE0OTo7APCBkgKVAiFFVWg3bndqcnhiVU1FT1dacHprWUFDRGY5R2d3QURnQVFBUkktMDFRM1Bqb0JsZ0FZUF9fX184UGFBQndBWGdCZ0FFQmlBRUJrQUVCbUFFQm9BRUJxQUVCc0FFQXVRRjFxdzFzbXBuSlA4RUItVDVCbjQzbTBEX0pBUUFBQQEDmFBBXzJRR3hGcDhDWUR6b1AtQUJ3b2s2OVFITnpFdy1tQUlBb0FMXwF2DEQ3VUMBMwhBTDAJCPBgTUFDQWNnQ0FkQUNBZGdDQWVBQ0FPZ0NBUGdDQUlBREFaZ0RBYWdENjhXMURMb0RDVUZOVXpFNk16azFNLUFEb0FtQUJPaWsxQUdJQkpyUTJ3R1FCQUEumgJhIXdSTW1idzYYATQzX1JvSUFRb0FER2FtWgECkG5KUHpvSlFVMVRNVG96T1RVelFLQUpTYkVXbndKZ1BPZ19VUUEFswEBAFcdDPBs2AIA4AKyrkzqAkZodHRwOi8vb3pvbmUudHBkYWRzLmNvbS9hZGFwdGVyLzEuNC41L3Rlc3Qtc2luZ2xlLmh0bWw_cGJqc19kZWJ1Zz10cnVl8gITCg9DVVNUT01fTU9ERUxfSUQSAPICGgoWQy4WAEBMRUFGX05BTUUSAPICHgoaQzIdAPCZQVNUX01PRElGSUVEEgCAAwGIAwGQAwCYAxSgAwGqAwDAA6wCyAMA2AMA4AMA6AMA-AMDgAQAkgQJL29wZW5ydGIymAQAogQMODEuMTUwLjAuMTExqATquwqyBAwIABAAGAAgADAAOAC4BADABADIBADSBA45OTc5I0FNUzE6Mzk1M9oEAggB4AQA8ATlmac5iAUBmAUAoAX__22cuAGqBSQ0MWM0YmQ1My04MjYzLTQ1YWYtYWU0Yi1lMmFhNWJmYzI2MjPABQDJBQAAAQIU8D_SBQkJAQoBAWjYBQHgBQHwBQH6BQQIABAAkAYAmAYAuAYBwQYBHywAAPA_yAYA2gYWChAJEBkBLBAAGADgBgHyBgIIAA..&s=43d30a0b51798165be3cec75879f87fbb6989baf&pp=${AUCTION_PRICE}\\\"><\\\/script>\",\"adomain\":[\"appnexus.com\"],\"iurl\":\"http:\\\/\\\/ams1-ib.adnxs.com\\\/cr?id=120179941\",\"cid\":\"9979\",\"crid\":\"120179941\",\"h\":90,\"w\":728,\"ext\":{\"appnexus\":{\"brand_id\":1,\"auction_id\":6136929831952088557,\"bidder_id\":2,\"bid_ad_type\":0}}}],\"seat\":\"9979\"}],\"bidid\":\"7236399423507214164\",\"cur\":\"USD\"}", "status": 200 } ], "beeswax": [ { "uri": "http:\/\/oz.eu-west-1.bid.bidr.io\/bid\/oz", "requestbody": "{\"id\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\",\"imp\":[{\"id\":\"75366327384845\",\"banner\":{\"format\":[{\"w\":300,\"h\":250},{\"w\":300,\"h\":600}],\"w\":300,\"h\":250,\"topframe\":1},\"pmp\":{},\"tagid\":\"0420420421\",\"secure\":0,\"ext\":{\"beeswax\":{}}},{\"id\":\"8ea269ab849ce8\",\"banner\":{\"format\":[{\"w\":728,\"h\":90},{\"w\":970,\"h\":250}],\"w\":728,\"h\":90,\"topframe\":1},\"pmp\":{},\"tagid\":\"0420420421\",\"secure\":0,\"ext\":{\"beeswax\":{}}}],\"site\":{\"domain\":\"tpdads.com\",\"page\":\"http:\/\/ozone.tpdads.com\/adapter\/1.4.5\/test-single.html?pbjs_debug=true\",\"publisher\":{}},\"device\":{\"ua\":\"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/73.0.3683.86 Safari\/537.36\",\"geo\":{\"country\":\"United Kingdom\",\"city\":\"Melksham\"},\"ip\":\"81.150.0.111\",\"h\":739,\"w\":1420},\"user\":{\"id\":\"ID=41b0c1627351084a:T=1542995502:S=ALNI_MaSQSy0YVymSk2GBeJpPPfUdlVKUw\",\"buyeruid\":\"AAEaf0635Q0AACEuzZGDWQ\",\"ext\":{\"consent\":\"\"}},\"at\":1,\"source\":{\"fd\":1,\"tid\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\"},\"regs\":{\"ext\":{\"gdpr\":1}}}", "responsebody": "", "status": 204 } ], "openx": [ { "uri": "http:\/\/rtb.openx.net\/prebid", "requestbody": "{\"id\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\",\"imp\":[{\"id\":\"75366327384845\",\"banner\":{\"format\":[{\"w\":300,\"h\":250},{\"w\":300,\"h\":600}],\"w\":300,\"h\":250,\"topframe\":1},\"tagid\":\"540221047\",\"secure\":0},{\"id\":\"8ea269ab849ce8\",\"banner\":{\"format\":[{\"w\":728,\"h\":90},{\"w\":970,\"h\":250}],\"w\":728,\"h\":90,\"topframe\":1},\"tagid\":\"540221047\",\"secure\":0}],\"site\":{\"domain\":\"tpdads.com\",\"page\":\"http:\/\/ozone.tpdads.com\/adapter\/1.4.5\/test-single.html?pbjs_debug=true\",\"publisher\":{\"id\":\"OZONENUK0001\"}},\"device\":{\"ua\":\"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/73.0.3683.86 Safari\/537.36\",\"geo\":{\"country\":\"United Kingdom\",\"city\":\"Melksham\"},\"ip\":\"81.150.0.111\",\"h\":739,\"w\":1420},\"user\":{\"id\":\"ID=41b0c1627351084a:T=1542995502:S=ALNI_MaSQSy0YVymSk2GBeJpPPfUdlVKUw\",\"buyeruid\":\"768900ca-1f62-0224-05af-96b460edde23\",\"ext\":{\"consent\":\"\"}},\"test\":1,\"at\":1,\"source\":{\"tid\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\"},\"regs\":{\"ext\":{\"gdpr\":1}},\"ext\":{\"delDomain\":\"sademo-d.openx.net\",\"bc\":\"hb_pbs_1.0.0\"}}", "responsebody": "{\"seatbid\":[{\"seat\":\"OpenX\",\"bid\":[{\"w\":300,\"price\":0.01,\"impid\":\"75366327384845\",\"id\":\"bfe21508-5e72-4b4d-b469-f7831f8614b9\",\"h\":250,\"crid\":\"540463358\",\"adm\":\"<div id='beacon_24281' style='position:absolute;left:0px;top:0px;visibility:hidden;'><img src='https:\/\/rtb-xa.openx.net\/win\/prebid?p=FIRST&t=2DAABBgABAAECAAIBAAsAAgAAAJkcGAp6ZUUxcTBxVmlPHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbl0u2Y9L31nYABFo2tz4ecn4SWlwEAFsSU6MkLFQYALBwVAgAcFQIAABwm7vmYgwQVBBUEJur5mIMEFtzgnoAE1hQAHCbEqp-ABBay1bWABBb8w7aDBBag9N2ABBUCHBT0AxTYBAAVBBUKFhQmFEUKAAAA&ph=a3aece0c-9e80-4316-8deb-faf804779bd1'\/><\/div><a href='http:\/\/sademo-d.openx.net\/w\/1.0\/rc?ts=2DAABBgABAAECAAIBAAsAAgAAAJkcGAp6ZUUxcTBxVmlPHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbl0u2Y9L31nYABFo2tz4ecn4SWlwEAFsSU6MkLFQYALBwVAgAcFQIAABwm7vmYgwQVBBUEJur5mIMEFtzgnoAE1hQAHCbEqp-ABBay1bWABBb8w7aDBBag9N2ABBUCHBT0AxTYBAAVBBUKFhQmFEUKAAAA' target='_blank'>\\n <img src='http:\/\/ox-i.sademo.servedbyopenx.com\/a3a\/a3aece0c-9e80-4316-8deb-faf804779bd1\/80e\/80eeedd896f54edfa01c82fdb6a372b7.jpg' height='250' width='300' border='0' alt=''\/>\\n<\/a>\\n<div id='beacon_24021' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'>\\n <img src='http:\/\/sademo-d.openx.net\/w\/1.0\/rr?ts=2DAABBgABAAECAAIBAAsAAgAAAJkcGAp6ZUUxcTBxVmlPHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbl0u2Y9L31nYABFo2tz4ecn4SWlwEAFsSU6MkLFQYALBwVAgAcFQIAABwm7vmYgwQVBBUEJur5mIMEFtzgnoAE1hQAHCbEqp-ABBay1bWABBb8w7aDBBag9N2ABBUCHBT0AxTYBAAVBBUKFhQmFEUKAAAA'\/>\\n<\/div>\\n<iframe src='https:\/\/us-u.openx.net\/w\/1.0\/pd?plm=6&ph=a3aece0c-9e80-4316-8deb-faf804779bd1&gdpr=1&gdpr_consent=' width='0' height='0' style='display:none;'><\/iframe>\"},{\"w\":728,\"price\":0.01,\"impid\":\"8ea269ab849ce8\",\"id\":\"d317294c-b76a-4f5b-96b4-d746bddb2fc6\",\"h\":90,\"crid\":\"538137717\",\"adm\":\"<div id='beacon_24294' style='position:absolute;left:0px;top:0px;visibility:hidden;'><img src='https:\/\/rtb-xa.openx.net\/win\/prebid?p=FIRST&t=2DAABBgABAAECAAIBAAsAAgAAAJgcGApXTENWUVU3UktsHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbJwq2J6azr6FkW88CmoqiulMvSAQAWxJToyQsVBgAsHBUCABwVAgAAHCbu-ZiDBBUEFQQm6vmYgwQW3OCegATWFAAcJsSqn4AEFrLVtYAEFurRmoEEFqD03YAEFQIcFLQBFLALABUEFQoWFCYURQoAAAA&ph=a3aece0c-9e80-4316-8deb-faf804779bd1'\/><\/div><a href='http:\/\/sademo-d.openx.net\/w\/1.0\/rc?ts=2DAABBgABAAECAAIBAAsAAgAAAJgcGApXTENWUVU3UktsHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbJwq2J6azr6FkW88CmoqiulMvSAQAWxJToyQsVBgAsHBUCABwVAgAAHCbu-ZiDBBUEFQQm6vmYgwQW3OCegATWFAAcJsSqn4AEFrLVtYAEFurRmoEEFqD03YAEFQIcFLQBFLALABUEFQoWFCYURQoAAAA' target='_blank'>\\n <img src='http:\/\/ox-i.sademo.servedbyopenx.com\/a3a\/a3aece0c-9e80-4316-8deb-faf804779bd1\/0c8\/0c8dd68f50234093bc08b7339ee0093d.jpg' height='90' width='728' border='0' alt=''\/>\\n<\/a>\\n<div id='beacon_24168' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'>\\n <img src='http:\/\/sademo-d.openx.net\/w\/1.0\/rr?ts=2DAABBgABAAECAAIBAAsAAgAAAJgcGApXTENWUVU3UktsHBaokpq45LPDmtUBFo3T0v25sJnbkAEAHBbJwq2J6azr6FkW88CmoqiulMvSAQAWxJToyQsVBgAsHBUCABwVAgAAHCbu-ZiDBBUEFQQm6vmYgwQW3OCegATWFAAcJsSqn4AEFrLVtYAEFurRmoEEFqD03YAEFQIcFLQBFLALABUEFQoWFCYURQoAAAA'\/>\\n<\/div>\\n<iframe src='https:\/\/us-u.openx.net\/w\/1.0\/pd?plm=6&ph=a3aece0c-9e80-4316-8deb-faf804779bd1&gdpr=1&gdpr_consent=' width='0' height='0' style='display:none;'><\/iframe>\"}]}],\"id\":\"41c4bd53-8263-45af-ae4b-e2aa5bfc2623\",\"cur\":\"USD\"}", "status": 200 } ] }, "resolvedrequest": { "id": "41c4bd53-8263-45af-ae4b-e2aa5bfc2623", "imp": [ { "id": "75366327384845", "banner": { "format": [ { "w": 300, "h": 250 }, { "w": 300, "h": 600 } ], "w": 300, "h": 250, "topframe": 1 }, "tagid": "0420420421", "secure": 0, "ext": { "appnexus": { "placement_id": 14302300 }, "beeswax": { "tagId": "0420420421" }, "openx": { "unit": "540221047", "delDomain": "sademo-d.openx.net" }, "ozone": { "adUnitCode": "mpu", "customData": { "pt1": "\/uk", "pt2": "uk", "pt3": "network-front", "pt4": "ng", "pt5": [ "uk" ], "pt7": "wide", "sens": "f" }, "lotameData": { "Profile": { "Audience": [ { "abbr": "all", "id": "439847" }, { "abbr": "Arts, Culture & Literature", "id": "446197" }, { "abbr": "Business", "id": "446198" } ], "pid": "3a45fd4872fa01f35c49586d8dcb7c60", "tpid": "4e5c21fc7c181c2b1eb3a73d543a27f6" } }, "ozoneData": { "age": "group2" }, "pubcid": "2d0789fa-2815-4e9a-8310-02323e697bce", "transactionId": "f20ae4e1-e391-4216-9e8b-95843792aeb4" }, "prebid": { "storedrequest": { "id": "0420420421" } } } }, { "id": "8ea269ab849ce8", "banner": { "format": [ { "w": 728, "h": 90 }, { "w": 970, "h": 250 } ], "w": 728, "h": 90, "topframe": 1 }, "tagid": "0420420421", "secure": 0, "ext": { "appnexus": { "placement_id": 14302300 }, "beeswax": { "tagId": "0420420421" }, "openx": { "unit": "540221047", "delDomain": "sademo-d.openx.net" }, "ozone": { "adUnitCode": "leaderboard", "customData": { "pt1": "\/uk", "pt2": "uk", "pt3": "network-front", "pt4": "ng", "pt5": [ "uk" ], "pt7": "wide", "sens": "f" }, "lotameData": { "Profile": { "Audience": [ { "abbr": "all", "id": "439847" }, { "abbr": "Arts, Culture & Literature", "id": "446197" }, { "abbr": "Business", "id": "446198" } ], "pid": "3a45fd4872fa01f35c49586d8dcb7c60", "tpid": "4e5c21fc7c181c2b1eb3a73d543a27f6" } }, "ozoneData": { "age": "group2" }, "pubcid": "2d0789fa-2815-4e9a-8310-02323e697bce", "transactionId": "c7abf2a4-fde5-415f-aded-6f003ab31946" }, "prebid": { "storedrequest": { "id": "0420420421" } } } } ], "site": { "domain": "tpdads.com", "page": "http:\/\/ozone.tpdads.com\/adapter\/1.4.5\/test-single.html?pbjs_debug=true", "publisher": { "id": "OZONENUK0001" } }, "device": { "ua": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/73.0.3683.86 Safari\/537.36", "geo": { "country": "United Kingdom", "city": "Melksham" }, "ip": "81.150.0.111", "h": 739, "w": 1420 }, "user": { "id": "ID=41b0c1627351084a:T=1542995502:S=ALNI_MaSQSy0YVymSk2GBeJpPPfUdlVKUw", "ext": { "consent": "" } }, "test": 1, "at": 1, "source": { "tid": "41c4bd53-8263-45af-ae4b-e2aa5bfc2623" }, "regs": { "ext": { "gdpr": 1 } } } }, "responsetimemillis": { "appnexus": 42, "beeswax": 4, "openx": 80 } } }

@AskRupert-DM
Copy link
Author

so upon further inspection - the adid I am seeing in that sample response is specific to the SSP and not the adID that prebid.js generates for the winning bid and sends in the ad-tags.

That would explain @bretg's comment about prebid.js handling this and @hhhjort comment about no reference in PBS to adid existing.

So my question is - I'm able to expose all bids on PBS - how / what changes can I make to my adaptor that PB JS uses to generate an adid for each of the bids PBS returns for a single ad unit back to my adapter ?

(am generating custom key-value to expose all the bids we get back but have don't know how I can generate an adid for each of those bids that PBJS can use / reference should the publishers ad-server decide they want to run a specific bid - e.g: 2 SSPs return a bid of the same value via PBS - publisher wants prioritises SSP1 over SSP2 but prebid is picking SSP2 as the winning adid - how / what can I expose so they can force/pick SSP1's bid in this scenario) ?

@jsnellbaker
Copy link
Contributor

@AskRupert-DM If I'm understanding you correctly, what you want is to be able to use the bidder specific keys (like hb_adid_ozone) instead of the generic keys (like hb_adid) - so that even another bidder won the auction, you could still show the bid for another bidder via the setup you have in your adserver.

If this is this case - what you want to change is not in your Prebid.js adapter code but rather in the Prebid creative code that you have setup in the adserver. The creative code's configuration is what decides which keys to look at and use as part of the rendering process. By default, the creative code is setup to use the generic keys to render the 'winning' bid rather than bidder specific keys.

From looking at the test page that was part of the request/response information you pasted (http://ozone.tpdads.com/adapter/1.4.5/test-single.html?pbjs_debug=true), I saw that you are using the Universal Creative code template for GAM/DFP.

You can use an alternate form of this code to use the bidder-specific keys. It would look like the following:

<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js"></script>
    <script>
      var ucTagData = {};
      ucTagData.adServerDomain = "";
      ucTagData.pubUrl = "%%PATTERN:url%%";
      ucTagData.adId = "%%PATTERN:hb_adid_BIDDERCODE%%";
      ucTagData.cacheHost = "%%PATTERN:hb_cache_host%%";
      ucTagData.cachePath = "%%PATTERN:hb_cache_path%%";
      ucTagData.uuid = "%%PATTERN:hb_cache_id_BIDDERCODE%%";
      ucTagData.mediaType = "%%PATTERN:hb_format_BIDDERCODE%%";
      ucTagData.env = "%%PATTERN:hb_env%%";
      ucTagData.size = "%%PATTERN:hb_size_BIDDERCODE%%";

      try {
        ucTag.renderAd(document, ucTagData);
      } catch (e) {
        console.log(e);
      }
    </script>

You would just need to replace the BIDDERCODE references in the above template with the actual biddercode for the bidder your line-item is targeting (like you used to for the old renderAd code).

Can you give this a try to see if it meets your needs? Please let me know if anything is unclear.

@AskRupert-DM
Copy link
Author

AskRupert-DM commented Mar 29, 2019

Hi @jsnellbaker - thanks for the reply !

  • so what I am trying to do is to have a specific adid keys for each SSP that my bidder is returning bids for - eg: oz_adid_appnexus vs oz_adid_openx so even if one of those SSPs wasn't the highest bidder - I can still potentially render/select the bid from a specific SSP regardless ?

If you look at the DFP calls on my test page you will see my adaptor generates oz_pb_[sspname] keys so just want to generate adid equivalents so a particular bid for a specific SSP can be rendered/selected (not just the highest bid) - however, at the moment I only get an adid created for my bidder (not each each respective bid my bidder is bringing back) ... so I guess my question is how do I setup my adaptor to return those keys as the adid isn't something that PBS generates and I'm not show how/where Prebid.JS creates those as right now the one adid value that is exposed for my bidder is automatically created by PBS and I'm trying to create SSP specific keys to return as I do for pricing.

Hope that makes sense / is clear ?

@jsnellbaker
Copy link
Contributor

So when I load your test page and look at the console logs, I see a combination of the Prebid.js targeting keys (the basic ones and the bidder specific ones) as well as the custom keys that you mentioned.

I have attached a screenshot of the keys that I see from the console output here:
Screen Shot 2019-03-29 at 3 37 30 PM

To clarify however this is when Prebid.js is using 2.1.0-pre (as per the prebid.js file you have hosted). When I load the page with the current version of Prebid.js (2.8.0) - the values that the custom keys are assigned are slightly different than what you're currently seeing.

I have attached another screenshot of the current Prebid.js output:
Screen Shot 2019-03-29 at 4 13 37 PM

Initially I would have suggested you could look at the custom keys you already have for the imp_id as an alternative to get the bid.adId (since it appeared to be the same). But this is no longer relevant for the current Prebid.js - so something else needs to be done.

Possible solution

The adapter file is now defining the custom keys in this area:
https://github.com/prebid/Prebid.js/blob/master/modules/ozoneBidAdapter.js#L237

If you want to create a new targeting key for the adId field - it would likely go somewhere in here. However you would also need to add logic to properly populate the adId property (notice the casing) in the bid object created by the adapter's interpretResponse function so that you can properly generate the key.

In the current version of the adapter, the bid that gets generated has a adid property but not a adId property. When the bid gets processed by the prebid core code later in the auction process, we create/populate the adId if it doesn't already exist in the bid (see here in the bidderFatory and then here in the bidFactory).

The adId property is what gets used in the keys and subsequently the creative code. So right now - because the bid's adId property gets populated later (after you generate your custom keys) - you wouldn't have access to the value to setup a custom key in the adapter code.

To make this work - you would need to populate the adId field in the adapter's intrepretResponse function when it's creating the bid object. This way, when the later code in prebid core runs - it would see that the field already exists and won't overwrite it.

I realize there is a lot of information here, so please let me know if you have any questions.

@bretg
Copy link
Contributor

bretg commented Mar 29, 2019

@AskRupert-DM - I'm not understanding the issue here -- this should already work.

So my question is - I'm able to expose all bids on PBS - how / what changes can I make to my adaptor that PB JS uses to generate an adid for each of the bids PBS returns for a single ad unit back to my adapter ?

Prebid Server never generates hb_adid. That's the job of Prebid.js. PBS just returns the body of the creative and PBJS generates an ID and the hb_adid value.

I've verified this on a test page: http://sneezy.aws.rubiconproject.com/rp-eng-soln/prebid/prebid_server_test_1001.html -- looking at the call going to DFP, I see hb_adid, hb_adid_rubicon, hb_adid_appnexus. Yet, hb_adid did not appear in the PBS response.

Are you just trying to display non-winning creatives, or provide feedback to SSPs about bad creatives? The former case is covered. The latter may not be.

If you continue to feel there's an issue, you're going to need to post a test page and clearly describe what you believe is missing. Thanks.

@AskRupert-DM
Copy link
Author

AskRupert-DM commented Mar 30, 2019

@bretg @jsnellbaker - have provided an example and details below which hopefully clarify the issue / what it is I am trying to do a bit more clearly:

Testpage: http://ozone.tpdads.com/adapter/1.4.5/test-single.html

You will see the following key-values get returned (for both slots but am just listing the first 300x250 slot here):

hb_format_ozone=banner&hb_source_ozone=client&hb_size_ozone=300x250&hb_pb_ozone=0.20&hb_adid_ozone=226f5705473a5a&hb_bidder_ozone=ozone&hb_format=banner&hb_source=client&hb_size=300x250&hb_pb=0.20&hb_adid=226f5705473a5a&hb_bidder=ozone&oz_response_id=c319af8a-960f-4e44-b320-2a4245cd55a0&oz_winner_imp_id=226f5705473a5a&oz_winner_auc_id=1925468974750442594&oz_winner=appnexus&oz_auc_id=c319af8a-960f-4e44-b320-2a4245cd55a0&oz_openx_imp_id=226f5705473a5a&oz_openx_adv=undefined&oz_openx_crid=540463358&oz_openx_pb=0.01&oz_openx=openx&oz_appnexus_imp_id=226f5705473a5a&oz_appnexus_adv=appnexus.com&oz_appnexus_crid=119683582&oz_appnexus_pb=0.26094&oz_appnexus=appnexus

There's the standard hb_ prebid key-values and a bunch of oz_ custom key-values. In this instance the 'ozone' bidder has returned two bids from appnexus and openx which I've exposed via the oz_[ssp-name] specific keys.

However, you will see there is only a hb_adid / hb_adid_ozone key for the winning bid which prebid.js is generating for the winning bid here (appnexus).

So my question is - how could I get prebid.js to expose a adid key-value for the openx bid - eg 'oz_openx_adid' that was returned here if for whatever reason the publisher wanted to run or prioritise these bids over the winning appnexus one ? Does that clear up what I am asking/trying to do here ?

@bretg
Copy link
Contributor

bretg commented Mar 30, 2019

Dug around a bit. You guys have built an alternate version of the prebidServerBidAdapter... a call to your ozone client adapter results in a call to your hosted Prebid Server that carries a stored request ID, which results in a series of bids from various sources.

So I think this is an architectural problem. Prebid.js doesn't expect bids for more than one bidder to come from a 'normal' adapter. I don't know that it's currently possible for a normal adapter to set targeting keys for other bidders. In fact, I kinda hope it's not possible, as it could be abused. I believe the prebidServerBidAdapter has special core-level functionality to do this -- it's considered a trusted multi-bidder adapter.

Will let @jsnellbaker and @mkendall07 comment on whether there is a technical workaround, but I'd like to step back and ask a bigger question... would you be willing to rearchitect your solution to use an enhanced prebidServerBidAdapter? If there's some custom logic in your JS, we could add a hook to support. As for stored-request-ids from PBJS, that's something I've been wanting to do anyhow, so would be happy to implement that part of the feature. Should be as simple as defining a place in the AdUnit to put the storedRequestId and updating pbsBidAdapter to pass it through the openRTB.

PS - Note that your test page should either remove rubicon and appnexus, or build your prebid_ozone_prod.js file to include the appnexus and openx bidAdapters. There are errors like "ERROR: Trying to make a request for bidder that does not exist: appnexus".

@AskRupert-DM
Copy link
Author

Hey @bretg apologies for the delayed response - I've been looking into a solution for my issue of the back of @jsnellbaker earlier feedback which actually was very useful - much appreciated @jsnellbaker !

I believe I've managed to find a fix/solution which appears to work... I've setup the following test page that used a version of my adapter which pointed to spoof'd bid-response endpoint which could include the adId attribute that @jsnellbaker suggested including/appending to each of my PBS bid responses...

http://ozone.tpdads.com/pbs/20190402/prebid_20190402_test.php - this is the desired behaviour where I am getting DFP to priorise/pick the openX bid regardless of whether its the winning bid

(aware these have the rubi/appnexus errors - I removed those adapters on purpose to avoid their targeting keys causing confusion and also aware that the code needs to be cleaned up but in short this should illustrate/explain the solution)

What I've done to achieve this (outside of the suggestion @jsnellbaker made around including a adid attribute in my bid-responses from PBS:

  1. In order to send custom targeting parameters to dfp, in interpretResponse we have to append the attribute: adserverTargeting (object) to each returned object. We do this already today to expose the extra KVPs you already see the adaptor exposing - so I've just added an extra line to pass/create adID keys for each SSP.

  2. If we want to render non-winning ads then we have to make sure that the internal call to auctionManager.findBidByAdId finds the non-winning ad from the adId sent to it. The array it stores internally is the array we return from interpretResponse. So I've amended the version of my adaptor on my test pages to have to return ALL the bids from interpretResponse, after parsing them & adding the full set of adserverTargeting to each one. Up until now the adapter was only sending the winning bid from interpretResponse.

Reading Documentation on interpretResponse : http://prebid.org/dev-docs/bidder-adaptor.html (see 'interpreting the response') - it says you can return none, one or more bids - so in short I've modified the adaptor to return all bids (i.e. one or more) - so think what I'm doing is within scope and not malicious or bad practise (I hope!).

RE: your question @bretg about 'rearchitecting our solution to use an enhanced prebid server adapter'

If a enhanced adapter was to exist in the future we would be more than happy to look at it and potentially migrate to it in the future - however, do want to flag that we're quite a way down the line with the use of our own adaptor and have spent a large amount of time working with publishers to deploy it in addition to making a number of changes on our end to PBS (eg: logging request and incoming attributes as well as the way we handle sending targeting onto each of SSPs) so migrating to a different adapter isn't as straightforward as what's been suggested (although top line the steps entailed will not be far of your suggestion).

Keep us posted/updated with timeframe's you may have in mind for when this could be available and we'll happily review it ... I've seen some tickets/issues open on both the prebid.js side around some of the stuff we spoken about (standardising targeting and supporting stored requests) and had some feedback which I'll try add to those tickets as soon as possible.

It would be great in the interim to get the feedback on the proposed solution around losing bid adIds which I'd like to include in our next adapter update.

@bretg
Copy link
Contributor

bretg commented Apr 3, 2019

@AskRupert-DM - I have reservations about this approach:

  1. you're basically a prebidServerBidAdapter, but without all the features currently enjoyed by that well-supported adapter like cookieSync, s2sTesting, extPrebid, syncUrlModifier, and passing server-side arguments.

  2. Related to fix user sync macro for index #1, we enhance pbsBidAdapter with some frequency. For instance there are 3 intent-to-implement issues open that will end up as upgrades to pbsBidAdapter. Your implementation will likely fall behind on some interesting features.

  1. It sets a precedence that other bid adapters can create ad server targeting values for other bidders. Prebid.org has worked to ensure that bidders cannot step on each other or even see each other's data/events in the client. Even by accident. Allowing this architecture opens publishers to a scenario where they might have two sources trying to set target for a single bidder. Granted, that could theoretically happen with PrebidServerBidAdapter, but it's much more clear to publishers using s2sConfig.bidders which bidders are server side and which are client side. Unclear to me that publishers will understand which bidders are involved in which way using your approach.

I will leave the merge decision to @mkendall07, but even if he allows it, I would require a warning on your prebid.org page (http://prebid.org/dev-docs/bidders.html#ozone) explaining to publishers that they must not run certain client-side bid adapters when they're using ozone or risk bid conflict.

Keep us posted/updated with timeframe's you may have in mind for when this could be available

We couldn't do this because we don't know what missing features drove you to build your own system. If you list all the features you would need in PrebidServerBidAdapter and PrebidServer, we'll consider them, though I'm certain it would be done faster if your team drove the effort with our support.

@AskRupert-DM
Copy link
Author

Thanks for the feedback - will review and once we get @mkendall07's feedback.

Want to clarify a couple of things based on your comments as possibly it may not be clear how we are operating:

(1) the bids we return and expose are ALL server side bid/bidders that we run on our instance of PBS - no different to what PBS bid adaptor does - however, we've exposed additional information from the bid-response in order to provide better transparency and insights to publishers via their ad-server log files... the prebidserver bid adapter exposes all bidder bids back to the client - we aren't doing anything different here in that regard...

(2) All the bids we return are grouped under the 'ozone' bidder-code and the custom key-values we write are differentiated from other bidders & that prebid.js sets by default to avoid any confusion.

(3) I understand the concern you raise around whether publishers will understand which bidders are involved, however we represent a small group of large publishers in the UK on an invite-only basis and are not a traditional SSP in that regard where this would probably be a bigger issue/concern.

@bretg
Copy link
Contributor

bretg commented Apr 3, 2019

(2) All the bids we return are grouped under the 'ozone' bidder-code and the custom key-values we write are differentiated from other bidders & that prebid.js sets by default to avoid any confusion.

Do you mean you're not utilizing hb_pb_bidder, but rather something like oz_pb_bidder? As long as you're not overwriting the standard hb_* targeting variables, I'm less concerned.

I still think you should be considering a migration to a more standard architecture because your server-side bidders may want features like cookieSync, syncUrlModifier, First Party Data, and MediaTypePriceGranularity.

@AskRupert-DM
Copy link
Author

Do you mean you're not utilizing hb_pb_bidder, but rather something like oz_pb_bidder? As long as you're not overwriting the standard hb_* targeting variables, I'm less concerned.

Correct - not overwriting any standard hb_* variables/values.

@mkendall07
Copy link
Member

I'm not really sure what I've been asked to weigh in on really. AFAIK there isn't a pull request here, or is this to ask if a pull request of the type above would be accepted?

As Bret mentioned, I'm less concerned about a bidder setting custom keys. That seems fairly harmless and I think a few PBJS bidders do it today.

@bretg
Copy link
Contributor

bretg commented Apr 11, 2019

Read through this again.

I don't approve of the solution of adding a non-OpenRTB attribute to the Prebid Server. First, because adId is not part of OpenRTB. Any new field we add needs to be in an ext.

But I also question why PBS would need to assign ad IDs at all. Your Prebid.js adapter can generate them.

PBS should not be generating anything except for cache IDs, and those only for the scenarios (e.g. VAST XML) where it's necessary. The model is that the browser stores the creatives in the javascript, assigns the adid, which is then used as the retrieval key for display.

@AskRupert-DM
Copy link
Author

Thanks for the feedback all - @bretg - have reviewed your feedback and have been able to find a method to generate the IDs via the adaptor.

What I was unaware of at the time of opening this issue was how the adId's got created/generated in the first place and I had assumed PBS was doing that when really PBJS / PB Core handles this.

As a quick test/PoC - I've updated my interpretResponse function in my adaptor to iterate over all the seatbids & inject adId keys based on the original adId that was assigned to the ozone bidder and append an integer onto the end to make the adId unique.

The original adId might have started out as for example - 83c3b04481e1878 , so I inject the key/value into the first bid object for this slot adId=83c3b04481e1878-0 , and for the second bid object for the same slot I'll inject adId=83c3b04481e1878-1 and so on.

This sets unique adId targeting to the Dom elements, and allow DFP to render the correct bid / adId.

Differences to the previous solution discussed:

  • There are no IDs generated on the prebid server
  • For each adslot we reuse the bidid generated by prebid core, simply amending a sequential identifier

Does this solution seem acceptable ?

@bretg
Copy link
Contributor

bretg commented Apr 18, 2019

Sounds fine to me. All contained within your PBJS adapter, right?

@AskRupert-DM
Copy link
Author

Yes all within the PBJS adapter (apologies do realise this thread/issue was now better placed in that forum rather than PBS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants