From e3168530183b573380fb64e23ff2052360529ec8 Mon Sep 17 00:00:00 2001 From: Antonios Sarhanis Date: Tue, 17 Dec 2024 10:27:56 +1100 Subject: [PATCH] Use advertiserDomains from ad response to pass to otb adomain parameter --- adapters/adnuntius/adnuntius.go | 28 ++++++++----------- .../exemplary/simple-banner.json | 1 + .../supplemental/check-dealId.json | 1 + ...heck-dsa-advertiser-legalName-omitted.json | 1 + .../check-dsa-advertiser-legalName.json | 1 + .../check-dsa-advertiser-omitted.json | 1 + .../supplemental/check-gdpr.json | 1 + .../supplemental/check-gross-bids.json | 1 + .../supplemental/check-net-bids.json | 1 + .../check-noCookies-parameter.json | 1 + .../supplemental/check-noCookies.json | 1 + .../supplemental/check-order-multi-imp.json | 2 ++ .../supplemental/check-userId.json | 1 + .../supplemental/empty-regs-ext.json | 1 + .../supplemental/empty-regs.json | 1 + .../supplemental/height-error.json | 1 + .../supplemental/max-deals-test.json | 2 ++ .../supplemental/send-header-information.json | 1 + .../adnuntiustest/supplemental/site-ext.json | 1 + .../supplemental/size-check.json | 1 + .../supplemental/test-networks.json | 1 + .../adnuntiustest/supplemental/user-ext.json | 1 + .../supplemental/width-error.json | 1 + 23 files changed, 35 insertions(+), 17 deletions(-) diff --git a/adapters/adnuntius/adnuntius.go b/adapters/adnuntius/adnuntius.go index e329c876c0..53736627d9 100644 --- a/adapters/adnuntius/adnuntius.go +++ b/adapters/adnuntius/adnuntius.go @@ -54,15 +54,16 @@ type Ad struct { GrossBid struct { Amount float64 } - DealID string `json:"dealId,omitempty"` - AdId string - CreativeWidth string - CreativeHeight string - CreativeId string - LineItemId string - Html string - DestinationUrls map[string]string - Advertiser adnAdvertiser `json:"advertiser,omitempty"` + DealID string `json:"dealId,omitempty"` + AdId string + CreativeWidth string + CreativeHeight string + CreativeId string + LineItemId string + Html string + DestinationUrls map[string]string + AdvertiserDomains []string + Advertiser adnAdvertiser `json:"advertiser,omitempty"` } type AdUnit struct { @@ -458,13 +459,6 @@ func generateAdResponse(ad Ad, imp openrtb2.Imp, html string, request *openrtb2. }} } - adDomain := []string{} - for _, url := range ad.DestinationUrls { - domainArray := strings.Split(url, "/") - domain := strings.Replace(domainArray[2], "www.", "", -1) - adDomain = append(adDomain, domain) - } - bid := openrtb2.Bid{ ID: ad.AdId, ImpID: imp.ID, @@ -476,7 +470,7 @@ func generateAdResponse(ad Ad, imp openrtb2.Imp, html string, request *openrtb2. CrID: ad.CreativeId, Price: price * 1000, AdM: html, - ADomain: adDomain, + ADomain: ad.AdvertiserDomains, Ext: extJson, } return &bid, nil diff --git a/adapters/adnuntius/adnuntiustest/exemplary/simple-banner.json b/adapters/adnuntius/adnuntiustest/exemplary/simple-banner.json index 94cef1d94d..1358d08a51 100644 --- a/adapters/adnuntius/adnuntiustest/exemplary/simple-banner.json +++ b/adapters/adnuntius/adnuntiustest/exemplary/simple-banner.json @@ -59,6 +59,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-dealId.json b/adapters/adnuntius/adnuntiustest/supplemental/check-dealId.json index ffd51edcf2..bf263dad3c 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-dealId.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-dealId.json @@ -59,6 +59,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName-omitted.json b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName-omitted.json index 591ee3909b..75675ae4b5 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName-omitted.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName-omitted.json @@ -78,6 +78,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName.json b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName.json index 98498aaa00..f9eebec361 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-legalName.json @@ -78,6 +78,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-omitted.json b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-omitted.json index e625fa63f7..9456c1fd9f 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-omitted.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-advertiser-omitted.json @@ -78,6 +78,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-gdpr.json b/adapters/adnuntius/adnuntiustest/supplemental/check-gdpr.json index 4fc36ecd03..5b5aaf14bb 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-gdpr.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-gdpr.json @@ -68,6 +68,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-gross-bids.json b/adapters/adnuntius/adnuntiustest/supplemental/check-gross-bids.json index 7d3b00d195..d2cdf1515d 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-gross-bids.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-gross-bids.json @@ -61,6 +61,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" }, "grossBid": {"amount": 0.1, "currency": "NOK"}, "netBid": {"amount": 0.075, "currency": "NOK"}, diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-net-bids.json b/adapters/adnuntius/adnuntiustest/supplemental/check-net-bids.json index 055ae55bab..27f08b7229 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-net-bids.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-net-bids.json @@ -61,6 +61,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" }, "grossBid": {"amount": 0.1, "currency": "NOK"}, "netBid": {"amount": 0.075, "currency": "NOK"}, diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies-parameter.json b/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies-parameter.json index ef5524c840..a4c1637bfe 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies-parameter.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies-parameter.json @@ -61,6 +61,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies.json b/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies.json index b05424d861..5e8f2f5f8e 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-noCookies.json @@ -65,6 +65,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-order-multi-imp.json b/adapters/adnuntius/adnuntiustest/supplemental/check-order-multi-imp.json index c58fc55f87..edf902ea6a 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-order-multi-imp.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-order-multi-imp.json @@ -84,6 +84,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" @@ -106,6 +107,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-userId.json b/adapters/adnuntius/adnuntiustest/supplemental/check-userId.json index 5a12c4b000..15cb06084d 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/check-userId.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-userId.json @@ -60,6 +60,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/empty-regs-ext.json b/adapters/adnuntius/adnuntiustest/supplemental/empty-regs-ext.json index eadb86f2db..b4eb94e2cb 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/empty-regs-ext.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/empty-regs-ext.json @@ -63,6 +63,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/empty-regs.json b/adapters/adnuntius/adnuntiustest/supplemental/empty-regs.json index 1c5452674f..aa871612cd 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/empty-regs.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/empty-regs.json @@ -62,6 +62,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/height-error.json b/adapters/adnuntius/adnuntiustest/supplemental/height-error.json index fa2107830a..75df3107aa 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/height-error.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/height-error.json @@ -60,6 +60,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/max-deals-test.json b/adapters/adnuntius/adnuntiustest/supplemental/max-deals-test.json index b018118faf..cca9d50ff7 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/max-deals-test.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/max-deals-test.json @@ -67,6 +67,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "cpm": { "amount": 1.0, "currency": "NOK" @@ -104,6 +105,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 0.001, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/send-header-information.json b/adapters/adnuntius/adnuntiustest/supplemental/send-header-information.json index 36d5a05bc1..42cd7d6372 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/send-header-information.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/send-header-information.json @@ -80,6 +80,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/site-ext.json b/adapters/adnuntius/adnuntiustest/supplemental/site-ext.json index 1ac96757b2..4cd4077703 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/site-ext.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/site-ext.json @@ -70,6 +70,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/size-check.json b/adapters/adnuntius/adnuntiustest/supplemental/size-check.json index e6defc341d..be44843751 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/size-check.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/size-check.json @@ -58,6 +58,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/test-networks.json b/adapters/adnuntius/adnuntiustest/supplemental/test-networks.json index 870df0b8f6..a8a60393ff 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/test-networks.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/test-networks.json @@ -60,6 +60,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/user-ext.json b/adapters/adnuntius/adnuntiustest/supplemental/user-ext.json index 5b0e50d114..83486dd066 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/user-ext.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/user-ext.json @@ -69,6 +69,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK" diff --git a/adapters/adnuntius/adnuntiustest/supplemental/width-error.json b/adapters/adnuntius/adnuntiustest/supplemental/width-error.json index c5633717c7..dabc6e62a9 100644 --- a/adapters/adnuntius/adnuntiustest/supplemental/width-error.json +++ b/adapters/adnuntius/adnuntiustest/supplemental/width-error.json @@ -60,6 +60,7 @@ "destinationUrls": { "url": "http://www.google.com" }, + "advertiserDomains": ["google.com"], "bid": { "amount": 20.0, "currency": "NOK"