Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/wwwyyy/prebid-server:
  GDPR: pass geo based on special feature 1 opt-in (prebid#2122)
  Adyoulike: Fix adapter errors if no content (prebid#2134)
  Update adyoulike.yaml (prebid#2131)
  Add ORTB 2.4 schain support (prebid#2108)
  Stored response fetcher (with new func for stored resp) (prebid#2099)
  Adot: Add OpenRTB macros resolution (prebid#2118)
  Rubicon adapter: accept accountId, siteId, zoneId as strings (prebid#2110)
  Operaads: support multiformat request (prebid#2121)
  Update go-gdpr to v1.11.0 (prebid#2125)
  Adgeneration: Update request to include device and app related info in headers and query params (prebid#2109)
  Adnuntius: Read device information from ortb Request (prebid#2112)
  New Adapter: apacdex and Remove Adapter: valueimpression (prebid#2097)
  New Adapter: Compass (prebid#2102)
  Orbidder: bidfloor currency handling (prebid#2093)
  • Loading branch information
w00522253 committed Jan 18, 2022
2 parents 2e0ea1c + 58ed9f9 commit 0678a70
Show file tree
Hide file tree
Showing 127 changed files with 4,833 additions and 826 deletions.
32 changes: 28 additions & 4 deletions adapters/adgeneration/adgeneration.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ func (adg *AdgenerationAdapter) MakeRequests(request *openrtb2.BidRequest, reqIn
headers := http.Header{}
headers.Add("Content-Type", "application/json;charset=utf-8")
headers.Add("Accept", "application/json")
if request.Device != nil && len(request.Device.UA) > 0 {
headers.Add("User-Agent", request.Device.UA)
if request.Device != nil {
if len(request.Device.UA) > 0 {
headers.Add("User-Agent", request.Device.UA)
}
if len(request.Device.IP) > 0 {
headers.Add("X-Forwarded-For", request.Device.IP)
}
}

bidRequestArray := make([]*adapters.RequestData, 0, numRequests)
Expand Down Expand Up @@ -102,7 +107,6 @@ func (adg *AdgenerationAdapter) getRawQuery(id string, request *openrtb2.BidRequ
v := url.Values{}
v.Set("posall", "SSPLOC")
v.Set("id", id)
v.Set("sdktype", "0")
v.Set("hb", "true")
v.Set("t", "json3")
v.Set("currency", adg.getCurrency(request))
Expand All @@ -112,12 +116,32 @@ func (adg *AdgenerationAdapter) getRawQuery(id string, request *openrtb2.BidRequ
if adSize != "" {
v.Set("sizes", adSize)
}
if request.Device != nil && request.Device.OS == "android" {
v.Set("sdktype", "1")
} else if request.Device != nil && request.Device.OS == "ios" {
v.Set("sdktype", "2")
} else {
v.Set("sdktype", "0")
}
if request.Site != nil && request.Site.Page != "" {
v.Set("tp", request.Site.Page)
}
if request.Source != nil && request.Source.TID != "" {
v.Set("transactionid", request.Source.TID)
}
if request.App != nil && request.App.Bundle != "" {
v.Set("appbundle", request.App.Bundle)
}
if request.App != nil && request.App.Name != "" {
v.Set("appname", request.App.Name)
}
if request.Device != nil && request.Device.OS == "ios" && request.Device.IFA != "" {
v.Set("idfa", request.Device.IFA)
}
if request.Device != nil && request.Device.OS == "android" && request.Device.IFA != "" {
v.Set("advertising_id", request.Device.IFA)
}

return &v
}

Expand Down Expand Up @@ -263,7 +287,7 @@ func removeWrapper(ad string) string {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
bidder := &AdgenerationAdapter{
config.Endpoint,
"1.0.2",
"1.0.3",
"JPY",
}
return bidder, nil
Expand Down
2 changes: 1 addition & 1 deletion adapters/adgeneration/adgeneration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestJsonSamples(t *testing.T) {
adapterstest.RunJSONBidderTest(t, "adgenerationtest", bidder)
}

func TestgetRequestUri(t *testing.T) {
func TestGetRequestUri(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdgeneration, config.Adapter{
Endpoint: "https://d.socdm.com/adsv/v1"})

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"mockBidRequest":{
"id": "some-request-id",
"site": {
"page": "http://example.com/test.html"
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36",
"ip": "0.0.0.0",
"os": "android",
"ifa": "advertising_id"
},
"app": {
"name": "adgneration"
},
"imp": [
{
"id": "some-impression-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"ext": {
"bidder": {
"id": "58278"
}
}
}
],
"tmax": 500
},
"httpCalls": [
{
"internalRequest": {
"id": "some-request-id",
"site": {
"page": "http://example.com/test.html"
},
"imp": [
{
"id": "some-impression-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"ext": {
"bidder": {
"id": "58278"
}
}
}
],
"tmax": 500
},
"expectedRequest":{
"uri": "https://d.socdm.com/adsv/v1?adapterver=1.0.3&advertising_id=advertising_id&appname=adgneration&currency=JPY&hb=true&id=58278&posall=SSPLOC&sdkname=prebidserver&sdktype=1&sizes=300x250&t=json3&tp=http%3A%2F%2Fexample.com%2Ftest.html",
"headers": {
"Accept": [
"application/json"
],
"Content-Type": [
"application/json;charset=utf-8"
],
"User-Agent": [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"
],
"X-Forwarded-For": [
"0.0.0.0"
]
}
},
"mockResponse":{
"status": 200,
"body": {
"ad": "<!DOCTYPE html>\n <head>\n <meta charset=\"UTF-8\">\n <script src=\"https:\/\/i.socdm.com\/sdk\/js\/adg-script-base.js\" type=\"text\/javascript\"><\/script>\n <script type=\"text\/javascript\">\n adsettings = {\n locationid : 58278,\n rotation : 0,\n displaytype : 1,\n sdktype : \"0\",\n scheduleid : 512601\n };\n <\/script>\n <style>\n body {\n margin:0;\n padding:0;\n }\n <\/style>\n <\/head>\n <body>\n <div id=\"medibasspContainer\">\n <iframe src=\"https:\/\/s3-ap-northeast-1.amazonaws.com\/sdk-temp\/adg-sample-ad\/300x250.html?prc=-Cuepak&rd=https%3A%2F%2Ftg.socdm.com%2Frd%2Fv1%2Fz%2FhKFj2gDXY2hzbT0xOTgsZmJkZGMyNWEvNTgyNzgvU1NQTE9DLzUxMjYwMS83MjExNS43Njg1NS41MTI2MDEvMTA5MzkyNi82NDkxOS81ODI3ODpTU1BMT0M6Ki9jdD0xNTg1MjEyMDg1Nzg5O3NyPWh0dHBzO2RzcGlkPTMwMTtwcj16RGFfYVY0O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTA5LjQzMDAwMDAwMDAwMDAxO2NyeTJkPTAuMDA5MTM4MjYxOTAyNTg2MTI3MztpZHg9MDulc2VxaWTaACQ0NzFhM2JlNS1lYTQzLWRhZjAtYjhjZi1mNjJkNTA1N2Y5ZWOnc2VxdGltZa0xNTg1MjEyMDg1Nzg5pHh1aWS4WE52SVNNQ281bUlBQU1hN2dOUUFBQUFB%2Fp%2Fctsv%3Dm-ad226%3Bseqid%3D471a3be5-ea43-daf0-b8cf-f62d5057f9ec%3B%2Fg%2FU%3A%3Furl%3D\" style=\"border: 0px;\" width=\"300\" height=\"250\" frameborder=\"0\" scrolling=\"no\"><\/iframe>\n <\/div>\n <\/body>\n",
"beacon": "<img src=\"https://tg.socdm.com/bc/v3?b=beaconID&amp;xuid=XUID&amp;ctsv=CTSV&amp;seqid=SeqID&amp;seqtime=SeqTime&amp;seqctx=SeqCtx&amp;t=.gif\" width=\"1\" height=\"1\" style=\"display:none;border:none;padding:0;margin:0;width:1px;height:1px\"/>",
"beaconurl": "https://tg.socdm.com/bc/v3?b=beaconID&t=.gif",
"cpm": 46.6,
"creativeid": "Dummy_supership.jp",
"displaytype": "1",
"h": 250,
"ids": {
"anid": "",
"diid": "",
"idfa": "",
"soc": "Soc"
},
"location_params": null,
"locationid": "58278",
"results": [
{
"ad": "<!DOCTYPE html>\n <head>\n <meta charset=\"UTF-8\">\n <script src=\"https:\/\/i.socdm.com\/sdk\/js\/adg-script-base.js\" type=\"text\/javascript\"><\/script>\n <script type=\"text\/javascript\">\n adsettings = {\n locationid : 58278,\n rotation : 0,\n displaytype : 1,\n sdktype : \"0\",\n scheduleid : 512601\n };\n <\/script>\n <style>\n body {\n margin:0;\n padding:0;\n }\n <\/style>\n <\/head>\n <body>\n <div id=\"medibasspContainer\">\n <iframe src=\"https:\/\/s3-ap-northeast-1.amazonaws.com\/sdk-temp\/adg-sample-ad\/300x250.html?prc=-Cuepak&rd=https%3A%2F%2Ftg.socdm.com%2Frd%2Fv1%2Fz%2FhKFj2gDXY2hzbT0xOTgsZmJkZGMyNWEvNTgyNzgvU1NQTE9DLzUxMjYwMS83MjExNS43Njg1NS41MTI2MDEvMTA5MzkyNi82NDkxOS81ODI3ODpTU1BMT0M6Ki9jdD0xNTg1MjEyMDg1Nzg5O3NyPWh0dHBzO2RzcGlkPTMwMTtwcj16RGFfYVY0O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTA5LjQzMDAwMDAwMDAwMDAxO2NyeTJkPTAuMDA5MTM4MjYxOTAyNTg2MTI3MztpZHg9MDulc2VxaWTaACQ0NzFhM2JlNS1lYTQzLWRhZjAtYjhjZi1mNjJkNTA1N2Y5ZWOnc2VxdGltZa0xNTg1MjEyMDg1Nzg5pHh1aWS4WE52SVNNQ281bUlBQU1hN2dOUUFBQUFB%2Fp%2Fctsv%3Dm-ad226%3Bseqid%3D471a3be5-ea43-daf0-b8cf-f62d5057f9ec%3B%2Fg%2FU%3A%3Furl%3D\" style=\"border: 0px;\" width=\"300\" height=\"250\" frameborder=\"0\" scrolling=\"no\"><\/iframe>\n <\/div>\n <\/body>\n",
"beacon": "<img src=\"https://tg.socdm.com/bc/v3?b=beaconID&amp;xuid=XUID&amp;ctsv=CTSV&amp;seqid=SeqID&amp;seqtime=SeqTime&amp;seqctx=SeqCtx&amp;t=.gif\" width=\"1\" height=\"1\" style=\"display:none;border:none;padding:0;margin:0;width:1px;height:1px\"/>",
"beaconurl": "https://tg.socdm.com/bc/v3?b=beaconID&t=.gif",
"cpm": 46.6,
"creativeid": "Dummy_supership.jp",
"h": 250,
"landing_url": "",
"scheduleid": "512601",
"trackers": {
"imp": [
"https://tg.socdm.com/bc/v3?b=beaconID&t=.gif"
],
"viewable_imp": [
"https://tg.socdm.com/aux/inview?creative_id=1093926&ctsv=CTSC&extra_field=ExtraField&family_id=512601&id=58278&loglocation_id=64919&lookupname=58278%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=72115.76855.512601&seqid=SeqID&seqtime=SeqTime&xuid=XUID"
],
"viewable_measured": [
"https://tg.socdm.com/aux/measured?creative_id=1093926&ctsv=CTSC&extra_field=ExtraField&family_id=512601&id=58278&loglocation_id=64919&lookupname=58278%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=72115.76855.512601&seqid=SeqID&seqtime=SeqTime&xuid=XUID"
]
},
"ttl": 10,
"w": 300,
"weight": 1
}
],
"dealid": "test-deal-id",
"rotation": "0",
"scheduleid": "512601",
"sdktype": "0",
"trackers": {
"imp": [
"https://tg.socdm.com/bc/v3?b=beaconID&t=.gif"
],
"viewable_imp": [
"https://tg.socdm.com/aux/inview?creative_id=1093926&ctsv=CTSC&extra_field=ExtraField&family_id=512601&id=58278&loglocation_id=64919&lookupname=58278%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=72115.76855.512601&seqid=SeqID&seqtime=SeqTime&xuid=XUID"
],
"viewable_measured": [
"https://tg.socdm.com/aux/measured?creative_id=1093926&ctsv=CTSC&extra_field=ExtraField&family_id=512601&id=58278&loglocation_id=64919&lookupname=58278%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=72115.76855.512601&seqid=SeqID&seqtime=SeqTime&xuid=XUID"
]
},
"ttl": 10,
"w": 300
}
}
}
],
"expectedBidResponses": [
{
"currency": "JPY",
"bids": [
{
"bid": {
"id": "58278",
"impid": "some-impression-id",
"price": 46.6,
"adm": "<div id=\"medibasspContainer\">\n <iframe src=\"https:\/\/s3-ap-northeast-1.amazonaws.com\/sdk-temp\/adg-sample-ad\/300x250.html?prc=-Cuepak&rd=https%3A%2F%2Ftg.socdm.com%2Frd%2Fv1%2Fz%2FhKFj2gDXY2hzbT0xOTgsZmJkZGMyNWEvNTgyNzgvU1NQTE9DLzUxMjYwMS83MjExNS43Njg1NS41MTI2MDEvMTA5MzkyNi82NDkxOS81ODI3ODpTU1BMT0M6Ki9jdD0xNTg1MjEyMDg1Nzg5O3NyPWh0dHBzO2RzcGlkPTMwMTtwcj16RGFfYVY0O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTA5LjQzMDAwMDAwMDAwMDAxO2NyeTJkPTAuMDA5MTM4MjYxOTAyNTg2MTI3MztpZHg9MDulc2VxaWTaACQ0NzFhM2JlNS1lYTQzLWRhZjAtYjhjZi1mNjJkNTA1N2Y5ZWOnc2VxdGltZa0xNTg1MjEyMDg1Nzg5pHh1aWS4WE52SVNNQ281bUlBQU1hN2dOUUFBQUFB%2Fp%2Fctsv%3Dm-ad226%3Bseqid%3D471a3be5-ea43-daf0-b8cf-f62d5057f9ec%3B%2Fg%2FU%3A%3Furl%3D\" style=\"border: 0px;\" width=\"300\" height=\"250\" frameborder=\"0\" scrolling=\"no\"><\/iframe>\n <\/div>\n <img src=\"https://tg.socdm.com/bc/v3?b=beaconID&amp;xuid=XUID&amp;ctsv=CTSV&amp;seqid=SeqID&amp;seqtime=SeqTime&amp;seqctx=SeqCtx&amp;t=.gif\" width=\"1\" height=\"1\" style=\"display:none;border:none;padding:0;margin:0;width:1px;height:1px\"/>",
"crid": "Dummy_supership.jp",
"w": 300,
"h": 250,
"dealid": "test-deal-id"
},
"type": "banner"
}
]
}
]
}

Loading

0 comments on commit 0678a70

Please sign in to comment.