diff --git a/adapters/audienceNetwork/audienceNetworktest/exemplary/banner-site.json b/adapters/audienceNetwork/audienceNetworktest/exemplary/banner-site.json deleted file mode 100644 index 01bab3dfd71..00000000000 --- a/adapters/audienceNetwork/audienceNetworktest/exemplary/banner-site.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-req-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - } - ], - "w": 300, - "h": 250 - }, - "ext": { - "bidder": { - "publisherid": "123", - "placementid": "456" - } - } - } - ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" - }, - "device": { - "ip": "152.193.6.74" - }, - "user": { - "id": "db089de9-a62e-4861-a881-0ff15e052516", - "buyeruid": "v4_bidder_token" - }, - "tmax": 500 - }, - "httpcalls": [ - { - "expectedRequest": { - "uri": "https://an.facebook.com/placementbid.ortb", - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json;charset=utf-8" - ], - "X-Fb-Pool-Routing-Token": [ - "v4_bidder_token" - ] - }, - "body": { - "id": "test-imp-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "w": -1, - "h": 250 - }, - "tagid": "123_456" - } - ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", - "publisher": { - "id": "123" - } - }, - "device": { - "ip": "152.193.6.74" - }, - "user": { - "id": "db089de9-a62e-4861-a881-0ff15e052516", - "buyeruid": "v4_bidder_token" - }, - "tmax": 500, - "ext": { - "authentication_id": "4e24a2b23fbfb5e41a9093b921d6cddf497c24dd5f63879038cec2ab2f27d174", - "platformid": "test-platform-id" - } - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-imp-id", - "seatbid": [ - { - "bid": [ - { - "id": "987", - "impid": "test-imp-id", - "price": 1.000000, - "adm": "{\"type\":\"ID\",\"bid_id\":\"987\",\"placement_id\":\"123_456\",\"resolved_placement_id\":\"123_456\",\"sdk_version\":\"5.5.0\",\"device_id\":\"abc\",\"template\":1,\"payload\":null,\"bid_time_token\":\"v4_bidder_token=\"}", - "nurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=0&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0", - "lurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=${AUCTION_LOSS}&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0", - "burl": "https://www.facebook.com/audiencenetwork/burl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&clearing_price=${AUCTION_PRICE}" - } - ] - } - ], - "bidid": "654", - "cur": "USD" - } - } - } - ], - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "987", - "impid": "test-imp-id", - "price": 1, - "adm": "{\"type\":\"ID\",\"bid_id\":\"987\",\"placement_id\":\"123_456\",\"resolved_placement_id\":\"123_456\",\"sdk_version\":\"5.5.0\",\"device_id\":\"abc\",\"template\":1,\"payload\":null,\"bid_time_token\":\"v4_bidder_token=\"}", - "adid": "987", - "crid": "987", - "nurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=0&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0", - "lurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=${AUCTION_LOSS}&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0", - "burl": "https://www.facebook.com/audiencenetwork/burl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&clearing_price=${AUCTION_PRICE}" - }, - "type": "banner" - } - ] - } - ] -} diff --git a/adapters/audienceNetwork/audienceNetworktest/exemplary/interstitial.json b/adapters/audienceNetwork/audienceNetworktest/exemplary/interstitial.json index 9f563f11948..573032c81e1 100644 --- a/adapters/audienceNetwork/audienceNetworktest/exemplary/interstitial.json +++ b/adapters/audienceNetwork/audienceNetworktest/exemplary/interstitial.json @@ -23,9 +23,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -64,9 +64,9 @@ "tagid": "123_456" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/exemplary/native-1.1.json b/adapters/audienceNetwork/audienceNetworktest/exemplary/native-1.1.json index 16bed344767..08639bee013 100644 --- a/adapters/audienceNetwork/audienceNetworktest/exemplary/native-1.1.json +++ b/adapters/audienceNetwork/audienceNetworktest/exemplary/native-1.1.json @@ -16,9 +16,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -56,9 +56,9 @@ "tagid": "123_456" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/exemplary/video.json b/adapters/audienceNetwork/audienceNetworktest/exemplary/video.json index 5ece0f08530..35bdf9a443e 100644 --- a/adapters/audienceNetwork/audienceNetworktest/exemplary/video.json +++ b/adapters/audienceNetwork/audienceNetworktest/exemplary/video.json @@ -21,9 +21,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -66,9 +66,9 @@ "tagid": "123_456" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/banner-format-only.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/banner-format-only.json index 5469fefbd65..450e0d9e45b 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/banner-format-only.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/banner-format-only.json @@ -24,9 +24,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -64,9 +64,9 @@ "tagid": "123_456" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-adm.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-adm.json index f145f5fe4ce..c33807bda74 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-adm.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-adm.json @@ -18,9 +18,9 @@ } } }], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -55,9 +55,9 @@ }, "tagid": "123_456" }], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-banner-height.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-banner-height.json index fa9fd9132b8..b229d41a27a 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-banner-height.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-banner-height.json @@ -22,9 +22,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-interstitial.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-interstitial.json index ad19d94c6e9..68ca8044812 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-interstitial.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/invalid-interstitial.json @@ -20,9 +20,9 @@ } } }], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm-bidid.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm-bidid.json index b57c900104e..50212155752 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm-bidid.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm-bidid.json @@ -18,9 +18,9 @@ } } }], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -55,9 +55,9 @@ }, "tagid": "123_456" }], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm.json index 23227aab959..832b16dca22 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-adm.json @@ -18,9 +18,9 @@ } } }], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -55,9 +55,9 @@ }, "tagid": "123_456" }], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-banner-height.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-banner-height.json index 016e8de0ef0..0793f990049 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-banner-height.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/missing-banner-height.json @@ -20,9 +20,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/multi-imp.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/multi-imp.json index 231c2826548..682c33e46b8 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/multi-imp.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/multi-imp.json @@ -41,9 +41,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -81,9 +81,9 @@ "tagid": "pub1_plmt1" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "pub1" } @@ -152,9 +152,9 @@ "tagid": "pub2_plmt2" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "pub2" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/no-bid-204.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/no-bid-204.json index 45b35e05dd9..642e495810a 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/no-bid-204.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/no-bid-204.json @@ -16,9 +16,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -56,9 +56,9 @@ "tagid": "123_456" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/no-imps.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/no-imps.json index 7420f7e8fb2..fccdf71ca4a 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/no-imps.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/no-imps.json @@ -2,9 +2,9 @@ "mockBidRequest": { "id": "test-req-id", "imp": [], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/required-buyeruid.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/required-buyeruid.json index 964dcb48b48..72b4fbacdd1 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/required-buyeruid.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/required-buyeruid.json @@ -26,9 +26,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-placementId.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-placementId.json index a9c3c23d298..f13b70e1be2 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-placementId.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-placementId.json @@ -25,9 +25,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-publisherId.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-publisherId.json index c50f3d36378..a80a1e09b65 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-publisherId.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/required-param-publisherId.json @@ -25,9 +25,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/server-error-500.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/server-error-500.json index 7ff8886139a..f0a11905cf8 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/server-error-500.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/server-error-500.json @@ -14,9 +14,9 @@ } } }], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -51,9 +51,9 @@ }, "tagid": "123_456" }], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/site-not-supported.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/site-not-supported.json new file mode 100644 index 00000000000..9155352a192 --- /dev/null +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/site-not-supported.json @@ -0,0 +1,38 @@ +{ + "mockBidRequest": { + "id": "test-req-id", + "imp": [{ + "id": "test-imp-id", + "banner": { + "format": [{ + "w": 300, + "h": 250 + }], + "w": 300, + "h": 250 + }, + "ext": { + "bidder": { + "publisherid": "123", + "placementid": "456" + } + } + }], + "site": { + "domain": "prebid.org", + "page": "prebid.org" + }, + "device": { + "ip": "152.193.6.74" + }, + "user": { + "id": "db089de9-a62e-4861-a881-0ff15e052516", + "buyeruid": "v4_bidder_token" + }, + "tmax": 500 + }, + "expectedMakeRequestsErrors": [{ + "value": "Site impressions are not supported.", + "comparison": "literal" + }] +} \ No newline at end of file diff --git a/adapters/audienceNetwork/audienceNetworktest/supplemental/split-placementId.json b/adapters/audienceNetwork/audienceNetworktest/supplemental/split-placementId.json index 34c1eccc58e..45c34192ea2 100644 --- a/adapters/audienceNetwork/audienceNetworktest/supplemental/split-placementId.json +++ b/adapters/audienceNetwork/audienceNetworktest/supplemental/split-placementId.json @@ -21,9 +21,9 @@ } } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org" + "app": { + "id": "app-abc", + "bundle": "com.prebid" }, "device": { "ip": "152.193.6.74" @@ -50,9 +50,9 @@ "tagid": "123_456" } ], - "site": { - "domain": "prebid.org", - "page": "prebid.org", + "app": { + "id": "app-abc", + "bundle": "com.prebid", "publisher": { "id": "123" } diff --git a/adapters/audienceNetwork/facebook.go b/adapters/audienceNetwork/facebook.go index f4091e4e23c..d9f6719fd17 100644 --- a/adapters/audienceNetwork/facebook.go +++ b/adapters/audienceNetwork/facebook.go @@ -54,6 +54,12 @@ func (this *FacebookAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo * }} } + if request.Site != nil { + return nil, []error{&errortypes.BadInput{ + Message: "Site impressions are not supported.", + }} + } + return this.buildRequests(request) } @@ -143,10 +149,6 @@ func (this *FacebookAdapter) modifyRequest(out *openrtb.BidRequest) error { app := *out.App app.Publisher = &openrtb.Publisher{ID: pubId} out.App = &app - } else { - site := *out.Site - site.Publisher = &openrtb.Publisher{ID: pubId} - out.Site = &site } if err = this.modifyImp(imp); err != nil { @@ -468,15 +470,11 @@ func (fa *FacebookAdapter) MakeTimeoutNotification(req *adapters.RequestData) (* return &adapters.RequestData{}, []error{err} } - // The publisher ID is either in the app object or the site object, depending on the supply of the request so we need - // to check both + // The publisher ID is expected in the app object pubID, err = jsonparser.GetString(req.Body, "app", "publisher", "id") if err != nil { - pubID, err = jsonparser.GetString(req.Body, "site", "publisher", "id") - if err != nil { - return &adapters.RequestData{}, []error{ - errors.New("path [app|site].publisher.id not found in the request"), - } + return &adapters.RequestData{}, []error{ + errors.New("path app.publisher.id not found in the request"), } } diff --git a/adapters/audienceNetwork/facebook_test.go b/adapters/audienceNetwork/facebook_test.go index 7f567d6137b..912f12223f8 100644 --- a/adapters/audienceNetwork/facebook_test.go +++ b/adapters/audienceNetwork/facebook_test.go @@ -61,23 +61,6 @@ func TestMakeTimeoutNoticeApp(t *testing.T) { assert.Equal(t, expectedUri, toReq.Uri, "Facebook timeout notification not returning the expected URI.") } -func TestMakeTimeoutNoticeSite(t *testing.T) { - req := adapters.RequestData{ - Body: []byte(`{"id":"1234","imp":[{"id":"1234"}],"site":{"publisher":{"id":"5678"}}}`), - } - fba := NewFacebookBidder("test-platform-id", "test-app-secret") - - tb, ok := fba.(adapters.TimeoutBidder) - if !ok { - t.Error("Facebook adapter is not a TimeoutAdapter") - } - - toReq, err := tb.MakeTimeoutNotification(&req) - assert.Nil(t, err, "Facebook MakeTimeoutNotification() return an error %v", err) - expectedUri := "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=5678&auction=1234&ortb_loss_code=2" - assert.Equal(t, expectedUri, toReq.Uri, "Facebook timeout notification not returning the expected URI.") -} - func TestMakeTimeoutNoticeBadRequest(t *testing.T) { req := adapters.RequestData{ Body: []byte(`{"imp":[{{"id":"1234"}}`), diff --git a/static/bidder-info/audienceNetwork.yaml b/static/bidder-info/audienceNetwork.yaml index 56230bf3f9a..324e5c6dff8 100644 --- a/static/bidder-info/audienceNetwork.yaml +++ b/static/bidder-info/audienceNetwork.yaml @@ -1,11 +1,6 @@ maintainer: email: "none" capabilities: - site: - mediaTypes: - - banner - - video - - native app: mediaTypes: - banner