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

LemmaDigital: add host parameter #3750

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adapters/lemmadigital/lemmadigital.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R

func (a *adapter) buildEndpointURL(params openrtb_ext.ImpExtLemmaDigital) (string, error) {
endpointParams := macros.EndpointTemplateParams{PublisherID: strconv.Itoa(params.PublisherId),
AdUnit: strconv.Itoa(params.AdId)}
AdUnit: strconv.Itoa(params.AdId), Host: params.Host}
return macros.ResolveMacros(a.endpoint, endpointParams)
}
2 changes: 1 addition & 1 deletion adapters/lemmadigital/lemmadigital_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderLemmadigital, config.Adapter{
Endpoint: "https://sg.ads.lemmatechnologies.com/lemma/servad?pid={{.PublisherID}}&aid={{.AdUnit}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
Endpoint: "https://{{.Host}}.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid={{.PublisherID}}&aid={{.AdUnit}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down
8 changes: 5 additions & 3 deletions adapters/lemmadigital/lemmadigitaltest/exemplary/banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"bidfloor": 0.1
Expand All @@ -32,7 +33,7 @@

"httpCalls": [{
"expectedRequest": {
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?pid=1&aid=1",
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid=1&aid=1",
"body": {
"id": "test-request-id",
"imp": [{
Expand All @@ -48,7 +49,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"bidfloor": 0.1
Expand Down
119 changes: 119 additions & 0 deletions adapters/lemmadigital/lemmadigitaltest/exemplary/dooh_banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [{
"id": "test-imp-id",
"banner": {
"format": [{
"w": 1920,
"h": 1080
}],
"w": 1920,
"h": 1080
},
"ext": {
"bidder": {
"aid": 1,
"pid": 1,
"host": "doohsg"
}
},
"qty": {
"multiplier": 1,
"sourcetype": 3
},
"bidfloor": 0.1
}],
"device": {
"ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
},
"dooh": {
"id": "1",
"name": "SCREEN_1",
"venuetype": ["retail.malls"]
}
},

"httpCalls": [{
"expectedRequest": {
"uri": "https://doohsg.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid=1&aid=1",
"body": {
"id": "test-request-id",
"imp": [{
"id": "test-imp-id",
"banner": {
"format": [{
"w": 1920,
"h": 1080
}],
"w": 1920,
"h": 1080
},
"ext": {
"bidder": {
"aid": 1,
"pid": 1,
"host": "doohsg"
}
},
"qty": {
"multiplier": 1,
"sourcetype": 3
},
"bidfloor": 0.1
}],
"device": {
"ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
},
"dooh": {
"id": "1",
"name": "SCREEN_1",
"venuetype": ["retail.malls"]
}
},
"impIDs":["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [{
"seat": "1",
"bid": [{
"id": "1239875642389471056",
"impid": "test-imp-id",
"price": 0.500000,
"adid": "1",
"adm": "some-test-ad",
"adomain": ["lemmadigital.com"],
"crid": "1",
"h": 1080,
"w": 1920,
"dealid": "test_deal"
}]
}],
"bidid": "1239875642389471056",
"cur": "USD"
}
}
}],

"expectedBidResponses": [{
"currency": "USD",
"bids": [{
"bid": {
"id": "1239875642389471056",
"impid": "test-imp-id",
"price": 0.5,
"adid": "1",
"adm": "some-test-ad",
"adomain": ["lemmadigital.com"],
"crid": "1",
"w": 1920,
"h": 1080,
"dealid": "test_deal"
},
"type": "banner"
}]
}]
}
100 changes: 100 additions & 0 deletions adapters/lemmadigital/lemmadigitaltest/exemplary/dooh_video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"mockBidRequest": {
"id": "test-request-id-video",
"imp": [{
"id": "test-imp-id-video",
"video": {
"mimes": ["video/mp4"],
"protocols": [1],
"w": 1920,
"h": 1080
},
"qty": {
"multiplier": 1,
"sourcetype": 3
},
"ext": {
"bidder": {
"aid": 1,
"pid": 1,
"host": "doohus"
}
}
}],
"dooh": {
"id": "1",
"name": "SCREEN_1",
"venuetype": ["outdoor.billboards.roadside"]
}
},

"httpCalls": [{
"expectedRequest": {
"uri": "https://doohus.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid=1&aid=1",
"body": {
"id": "test-request-id-video",
"imp": [{
"id": "test-imp-id-video",
"video": {
"mimes": ["video/mp4"],
"protocols": [1],
"w": 1920,
"h": 1080
},
"qty": {
"multiplier": 1,
"sourcetype": 3
},
"ext": {
"bidder": {
"aid": 1,
"pid": 1,
"host": "doohus"
}
}
}],
"dooh": {
"id": "1",
"name": "SCREEN_1",
"venuetype": ["outdoor.billboards.roadside"]
}
},
"impIDs":["test-imp-id-video"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id-video",
"seatbid": [{
"seat": "1",
"bid": [{
"id": "1239875642389471056",
"impid": "test-imp-id-video",
"price": 0.500000,
"adm": "some-test-ad",
"crid": "crid_video",
"h": 1080,
"w": 1920
}]
}],
"cur": "USD"
}
}
}],

"expectedBidResponses": [{
"currency": "USD",
"bids": [{
"bid": {
"id": "1239875642389471056",
"impid": "test-imp-id-video",
"price": 0.5,
"adm": "some-test-ad",
"crid": "crid_video",
"w": 1920,
"h": 1080
},
"type": "video"
}]
}]
}
14 changes: 9 additions & 5 deletions adapters/lemmadigital/lemmadigitaltest/exemplary/multi-imp.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"bidfloor": 0.1
Expand All @@ -31,7 +32,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"bidfloor": 0.12
Expand All @@ -49,7 +51,7 @@

"httpCalls": [{
"expectedRequest": {
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?pid=1&aid=1",
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid=1&aid=1",
"body": {
"id": "test-request-id",
"imp": [{
Expand All @@ -65,7 +67,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"bidfloor": 0.1
Expand All @@ -82,7 +85,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"bidfloor": 0.12
Expand Down
8 changes: 5 additions & 3 deletions adapters/lemmadigital/lemmadigitaltest/exemplary/video.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
}
}],
Expand All @@ -25,7 +26,7 @@

"httpCalls": [{
"expectedRequest": {
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?pid=1&aid=1",
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid=1&aid=1",
"body": {
"id": "test-request-id-video",
"imp": [{
Expand All @@ -39,7 +40,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
}
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"id": "test-imp-id-video",
Expand All @@ -42,7 +43,7 @@
},
"httpCalls": [{
"expectedRequest": {
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?pid=1&aid=1",
"uri": "https://sg.ads.lemmatechnologies.com/lemma/servad?src=prebid&pid=1&aid=1",
"body": {
"app": {
"bundle": "com.ld.test",
Expand All @@ -67,7 +68,8 @@
"ext": {
"bidder": {
"aid": 1,
"pid": 1
"pid": 1,
"host": "sg"
}
},
"id": "test-imp-id-video",
Expand Down
Loading