BidResponse bid_response;
// fill in bid response with bid information
string post_response;
if (bid_response.SerializeToString(&post_response)) {
// respond to the POST with post_response as the content
} else {
// return an error to the POST
}
在 BidResponse.seatbid.bid.adm 欄位中使用 HTML 程式碼片段,指定在您自有伺服器上託管的廣告。程式碼片段會封裝在插入網頁的 iFrame 中,因此在載入網頁時,系統會擷取並轉譯廣告。您必須編寫 HTML 程式碼片段,讓廣告 (橫幅或插頁式廣告) 正確顯示在 iFrame 中,並以適當的大小顯示在您出價的廣告版位中。
此外,在下列情況下,出價回應中宣告的大小必須與出價要求中完全相符的大小組合相符:
廣告是一般橫幅廣告 (不是影片、原生或插頁式廣告)。
出價者已在出價回應中宣告大小。請求中只要有兩種以上的大小,就必須宣告大小。
插頁式廣告則例外。插頁式廣告的寬度必須至少為螢幕寬度的 50%,高度則至少為螢幕高度的 40%。
您可以使用任何有效的 HTML 程式碼指定 HTML 廣告素材片段,但請注意,在「Create BidResponse message」部分指定 crid 欄位的限制。這項功能的其中一個用途,就是在擷取自伺服器的網址引數中加入額外資訊,以便在算繪廣告時使用。這樣一來,您就能將曝光次數的任意資料傳回至自己的伺服器。
id:"96Z599PGNvp7Mr99138Fm0"seatbid{bid{id:"NQb32Ge7Rtt84wFn2p8"impid:"1"price:0.153584adid:"test_creative_id_272596"adomain:"google.com"crid:"test_creative_id_272596"cat:"IAB13-7"burl:"https://test.com/imp?id=123456"adm_native{ver:"1.2"assets{id:1required:truetitle{text:"Luxury Mars Cruises"}}assets{id:2required:truedata{value:"Visit the planet in a luxury spaceship."}}assets{id:3required:falsedata{value:"Book today"}}assets{id:4required:truedata{value:"Galactic Luxury Cruises"}}assets{id:5required:trueimg{url:"https://native.test.com/image?id=123456"w:1200h:627}}link{url:"https://www.google.com"}eventtrackers{event:IMPRESSIONmethod:IMGurl:"https://test.com/event?id=123456"}privacy:"https://adssettings.google.com/whythisad?source=display&reasons=OMITTED"}[com.google.doubleclick.bid]{ad_choices_destination_url:"https://test.com/preferences"billing_id:29846056590dsa{behalf:"TEST_ADVERTISER"paid:"TEST_PAYING_ENTITY"adrender:false}}}bid{id:"4vwb23qm6iqU6w6G978"impid:"1"price:0.153584adid:"test_creative_id_272596"adomain:"google.com"crid:"test_creative_id_272596"cat:"IAB21"burl:"https://test.com/imp?id=123456"adm_native{ver:"1.2"assets{id:1required:truetitle{text:"Luxury Mars Cruises"}}assets{id:2required:truedata{value:"Visit the planet in a luxury spaceship."}}assets{id:3required:falsedata{value:"Book today"}}assets{id:4required:truedata{value:"Galactic Luxury Cruises"}}assets{id:5required:trueimg{url:"https://native.test.com/image?id=123456"w:1200h:627}}link{url:"https://www.google.com"}eventtrackers{event:IMPRESSIONmethod:IMGurl:"https://test.com/event?id=123456"}privacy:"https://adssettings.google.com/whythisad?source=display&reasons=OMITTED"}[com.google.doubleclick.bid]{ad_choices_destination_url:"https://test.com/preferences"dsa{behalf:"TEST_ADVERTISER"paid:"TEST_PAYING_ENTITY"adrender:false}}}seat:"4528:1161:591635"group:false}bidid:"hgu4ev7j-ZK929XM0-79f7-0A23O0VN2CFC"cur:"USD"
OpenRTB JSON
顯示範例
{"id":"96Z599PGNvp7Mr99138Fm0","seatbid":[{"bid":[{"id":"NQb32Ge7Rtt84wFn2p8","impid":"1","price":0.153584,"adid":"test_creative_id_272596","adomain":["google.com"],"crid":"test_creative_id_272596","cat":["IAB13-7"],"burl":"https://test.com/imp?id=123456","ext":{"ad_choices_destination_url":"https://test.com/preferences","billing_id":"29846056590","dsa":{"behalf":"TEST_ADVERTISER","paid":"TEST_PAYING_ENTITY","adrender":0}},"adm":"{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"text\":\"Luxury Mars Cruises\"}},{\"id\":2,\"required\":1,\"data\":{\"value\":\"Visit the planet in a luxury spaceship.\"}},{\"id\":3,\"required\":0,\"data\":{\"value\":\"Book today\"}},{\"id\":4,\"required\":1,\"data\":{\"value\":\"Galactic Luxury Cruises\"}},{\"id\":5,\"required\":1,\"img\":{\"url\":\"https://native.test.com/image?id=123456\",\"w\":1200,\"h\":627}}],\"link\":{\"url\":\"https://www.google.com\"},\"eventtrackers\":[{\"event\":1,\"method\":1,\"url\":\"https://test.com/event?id=123456\"}],\"privacy\":\"https://adssettings.google.com/whythisad?source=display&reasons=OMITTED\"}"},{"id":"4vwb23qm6iqU6w6G978","impid":"1","price":0.153584,"adid":"test_creative_id_272596","adomain":["google.com"],"crid":"test_creative_id_272596","cat":["IAB21"],"burl":"https://test.com/imp?id=123456","ext":{"ad_choices_destination_url":"https://test.com/preferences","dsa":{"behalf":"TEST_ADVERTISER","paid":"TEST_PAYING_ENTITY","adrender":0}},"adm":"{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"text\":\"Luxury Mars Cruises\"}},{\"id\":2,\"required\":1,\"data\":{\"value\":\"Visit the planet in a luxury spaceship.\"}},{\"id\":3,\"required\":0,\"data\":{\"value\":\"Book today\"}},{\"id\":4,\"required\":1,\"data\":{\"value\":\"Galactic Luxury Cruises\"}},{\"id\":5,\"required\":1,\"img\":{\"url\":\"https://native.test.com/image?id=123456\",\"w\":1200,\"h\":627}}],\"link\":{\"url\":\"https://www.google.com\"},\"eventtrackers\":[{\"event\":1,\"method\":1,\"url\":\"https://test.com/event?id=123456\"}],\"privacy\":\"https://adssettings.google.com/whythisad?source=display&reasons=OMITTED\"}"}],"seat":"4528:1161:591635","group":0}],"bidid":"hgu4ev7j-ZK929XM0-79f7-0A23O0VN2CFC","cur":"USD"}
[null,null,["上次更新時間:2025-08-21 (世界標準時間)。"],[[["\u003cp\u003eBid responses must be serialized \u003ccode\u003eBidResponse\u003c/code\u003e protocol buffers with the \u003ccode\u003eContent-Type\u003c/code\u003e header set to \u003ccode\u003eapplication/octet-stream\u003c/code\u003e for Protobuf, and a parsable \u003ccode\u003eBidResponse\u003c/code\u003e is required for each \u003ccode\u003eBidRequest\u003c/code\u003e, while an empty HTTP 204 response signals no bid.\u003c/p\u003e\n"],["\u003cp\u003eEach creative needs a unique \u003ccode\u003ecrid\u003c/code\u003e (creative ID) limited to 64 bytes, and this ID must be unique across creatives if there are differences in size, declared URL, attributes, vendor types, appearance, behavior, or rendering method.\u003c/p\u003e\n"],["\u003cp\u003eAd characteristics should be declared using \u003ccode\u003eBidResponse.seatbid.bid.apis\u003c/code\u003e, \u003ccode\u003eBidResponse.seatbid.bid.attr\u003c/code\u003e, or \u003ccode\u003eBidResponse.seatbid.bid.ext.attribute\u003c/code\u003e, with specific values indicating VPAID, MRAID, SIZELESS, or PLAYABLE attributes, respectively, and additional attributes from \u003ccode\u003ebuyer-declarable-creative-attributes.txt\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eResponses should remain under 8KB, utilize persistent HTTPS connections with at least a 10-second timeout, and employ \u003ccode\u003eBidResponse.seatbid.bid.burl\u003c/code\u003e or \u003ccode\u003eBidResponse.seatbid.bid.ext.impression_tracking_url\u003c/code\u003e for tracking impressions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBidResponse\u003c/code\u003e must accurately set creative attributes (\u003ccode\u003eBidResponse.seatbid.bid.attr\u003c/code\u003e), categories (\u003ccode\u003eBidResponse.seatbid.bid.cat\u003c/code\u003e), and advertiser domain (\u003ccode\u003eBidResponse.seatbid.bid.adomain\u003c/code\u003e) or native ad link (\u003ccode\u003eBidResponse.seatbid.bid.adm_native.link.url\u003c/code\u003e), as responses lacking these are discarded.\u003c/p\u003e\n"]]],["Applications must respond to each `BidRequest` with a parsable `BidResponse`, using Protobuf or an HTTP 204 for no bids. Creatives are identified by a unique `crid`. Ad attributes, such as VPAID and MRAID, are declared in specific fields. Utilize impression tracking URLs and avoid deprecated fields. Open Bidding bid responses are similar to Authorized Buyers. Ad sizes in the response must match the request. Macros are used in URLs. Publisher requirements are specified in the `BidRequest`. The response must accurately reflect these requirements and provide the accurate ad attributes and links.\n"],null,[]]