From a406808c60e43e0c01048a77fc4f4609f3651b22 Mon Sep 17 00:00:00 2001 From: mwang-sticky Date: Thu, 2 May 2024 16:11:35 +0800 Subject: [PATCH] Freewheel: add video dur and cat (#3640) --- adapters/freewheelssp/freewheelssp.go | 17 ++++++++--- .../freewheelssptest/exemplary/multi-imp.json | 29 +++++++++++++++---- static/bidder-info/freewheelssp.yaml | 2 +- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/adapters/freewheelssp/freewheelssp.go b/adapters/freewheelssp/freewheelssp.go index b11cf7c3f77..df6f756bb65 100644 --- a/adapters/freewheelssp/freewheelssp.go +++ b/adapters/freewheelssp/freewheelssp.go @@ -87,11 +87,20 @@ func (a *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest for _, seatBid := range bidResp.SeatBid { for i := range seatBid.Bid { - b := &adapters.TypedBid{ - Bid: &seatBid.Bid[i], - BidType: bidType, + bid := seatBid.Bid[i] + bidVideo := openrtb_ext.ExtBidPrebidVideo{} + if len(bid.Cat) > 0 { + bidVideo.PrimaryCategory = bid.Cat[0] } - bidResponse.Bids = append(bidResponse.Bids, b) + if bid.Dur > 0 { + bidVideo.Duration = int(bid.Dur) + } + adTypeBid := &adapters.TypedBid{ + Bid: &bid, + BidType: bidType, + BidVideo: &bidVideo, + } + bidResponse.Bids = append(bidResponse.Bids, adTypeBid) } } return bidResponse, nil diff --git a/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json b/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json index 3060341c954..2562a812edc 100644 --- a/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json +++ b/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json @@ -89,7 +89,10 @@ "adid": "7857", "adm": "", "cid": "4001", - "crid": "7857" + "crid": "7857", + "adomain":["freewheel.com"], + "cat": ["IAB10"], + "dur": 14 }, { "id": "12346_freewheelssp-test_2", @@ -98,7 +101,9 @@ "adid": "7933", "adm": "", "cid": "3476", - "crid": "7933" + "crid": "7933", + "adomain":["freewheel.com"], + "dur":10 } ], "seat": "freewheelsspTv" @@ -123,9 +128,16 @@ "adid": "7857", "adm": "", "cid": "4001", - "crid": "7857" + "crid": "7857", + "adomain":["freewheel.com"], + "cat": ["IAB10"], + "dur": 14 }, - "type": "video" + "type": "video", + "video" : { + "duration" : 14, + "primary_category": "IAB10" + } }, { "bid": { @@ -135,9 +147,14 @@ "adid": "7933", "adm": "", "cid": "3476", - "crid": "7933" + "crid": "7933", + "adomain":["freewheel.com"], + "dur":10 }, - "type": "video" + "type": "video", + "video" : { + "duration" : 10 + } } ] } diff --git a/static/bidder-info/freewheelssp.yaml b/static/bidder-info/freewheelssp.yaml index 8c9286cbbc0..0c0a11edfce 100644 --- a/static/bidder-info/freewheelssp.yaml +++ b/static/bidder-info/freewheelssp.yaml @@ -13,4 +13,4 @@ capabilities: userSync: iframe: url: "https://ads.stickyadstv.com/pbs-user-sync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&r={{.RedirectURL}}" - userMacro: "{viewerid}" \ No newline at end of file + userMacro: "{viewerid}"