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

Idsync removal #1644

Merged
merged 17 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from 13 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
40 changes: 34 additions & 6 deletions adapters/dmx/dmx.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ type dmxExt struct {
Bidder dmxParams `json:"bidder"`
}

type dmxPubExt struct {
Dmx dmxPubExtId `json:"dmx,omitempty"`
}

type dmxPubExtId struct {
Id string `json:"id,omitempty"`
}

type dmxParams struct {
TagId string `json:"tagid,omitempty"`
DmxId string `json:"dmxid,omitempty"`
MemberId string `json:"memberid,omitempty"`
PublisherId string `json:"publisher_id,omitempty"`
SellerId string `json:"seller_id,omitempty"`
TagId string `json:"tagid,omitempty"`
DmxId string `json:"dmxid,omitempty"`
MemberId string `json:"memberid,omitempty"`
PublisherId string `json:"publisher_id,omitempty"`
SellerId string `json:"seller_id,omitempty"`
Bidfloor float64 `json:"bidfloor,omitempty"`
stevealliance marked this conversation as resolved.
Show resolved Hide resolved
}

func UserSellerOrPubId(str1, str2 string) string {
Expand All @@ -55,6 +64,7 @@ func (adapter *DmxAdapter) MakeRequests(request *openrtb.BidRequest, req *adapte
var anyHasId = false
var reqCopy openrtb.BidRequest = *request
stevealliance marked this conversation as resolved.
Show resolved Hide resolved
var dmxReq *openrtb.BidRequest = &reqCopy
var dmxRawPubId dmxPubExt

if request.User == nil {
if request.App == nil {
Expand All @@ -77,6 +87,14 @@ func (adapter *DmxAdapter) MakeRequests(request *openrtb.BidRequest, req *adapte
appPublisherCopy := *request.App.Publisher
dmxReq.App = &appCopy
dmxReq.App.Publisher = &appPublisherCopy
if dmxReq.App.Publisher.ID == "" {
dmxReq.App.Publisher.ID = publisherId
}
dmxRawPubId.Dmx.Id = UserSellerOrPubId(rootExtInfo.Bidder.PublisherId, rootExtInfo.Bidder.MemberId)
ext, err := json.Marshal(dmxRawPubId)
if err == nil {
stevealliance marked this conversation as resolved.
Show resolved Hide resolved
}
dmxReq.App.Publisher.Ext = ext
if dmxReq.App.ID != "" {
anyHasId = true
}
Expand All @@ -90,7 +108,14 @@ func (adapter *DmxAdapter) MakeRequests(request *openrtb.BidRequest, req *adapte
dmxReq.Site = &siteCopy
dmxReq.Site.Publisher = &sitePublisherCopy
if dmxReq.Site.Publisher != nil {
dmxReq.Site.Publisher.ID = publisherId
if dmxReq.Site.Publisher.ID == "" {
dmxReq.Site.Publisher.ID = publisherId
}
dmxRawPubId.Dmx.Id = UserSellerOrPubId(rootExtInfo.Bidder.PublisherId, rootExtInfo.Bidder.MemberId)
ext, err := json.Marshal(dmxRawPubId)
if err == nil {
}
dmxReq.Site.Publisher.Ext = ext
} else {
dmxReq.Site.Publisher = &openrtb.Publisher{ID: publisherId}
}
Expand Down Expand Up @@ -229,6 +254,9 @@ func (adapter *DmxAdapter) MakeBids(request *openrtb.BidRequest, externalRequest
func fetchParams(params dmxExt, inst openrtb.Imp, ins openrtb.Imp, imps []openrtb.Imp, banner *openrtb.Banner, video *openrtb.Video, intVal int8) []openrtb.Imp {
var tempimp openrtb.Imp
tempimp = inst
if params.Bidder.Bidfloor != 0 {
tempimp.BidFloor = params.Bidder.Bidfloor
}
if params.Bidder.TagId != "" {
tempimp.TagID = params.Bidder.TagId
tempimp.Secure = &intVal
Expand Down
7 changes: 6 additions & 1 deletion adapters/dmx/dmxtest/exemplary/imp-populated-banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@
"id":"ed6207cefff74c14878963566683c070",
"name":"Skout - iOS Match Buy",
"publisher":{
"id":"10400"
"id":"10400",
"ext": {
"dmx": {
"id": "10400"
}
}
},
"storeurl":"https://itunes.apple.com/app/id302324249"
},
Expand Down
7 changes: 6 additions & 1 deletion adapters/dmx/dmxtest/exemplary/simple-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@
"id":"ed6207cefff74c14878963566683c070",
"name":"Skout - iOS Match Buy",
"publisher":{
"id":"10400"
"id":"10400",
"ext": {
"dmx": {
"id": "10400"
}
}
},
"storeurl":"https://itunes.apple.com/app/id302324249"
},
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func (cfg *Configuration) setDerivedDefaults() {
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderConversant, "https://prebid-match.dotomi.com/match/bounce/current?version=1&networkId=72582&rurl="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dconversant%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderCpmstar, "https://server.cpmstar.com/usersync.aspx?gdpr={{.GDPR}}&consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dcpmstar%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderDatablocks, "https://sync.v5prebid.datablocks.net/s2ssync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&r="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Ddatablocks%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24%7Buid%7D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderDmx, "https://dmx.districtm.io/s/v1/img/s/10007?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&redirect="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Ddatablocks%26gdpr%3D%24%7Bgdpr%7D%26gdpr_consent%3D%24%7Bgdpr_consent%7D%26uid%3D%24%7Buid%7D")
// openrtb_ext.BidderDMX doesn't have a good default.
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderDeepintent, "https://match.deepintent.com/usersync/136?id=unk&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Ddeepintent%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%5BUID%5D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderEmxDigital, "https://cs.emxdgt.com/um?ssp=pbs&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Demx_digital%26uid%3D%24UID")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderEngageBDR, "https://match.bnmla.com/usersync/s2s_sync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&r="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dengagebdr%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24%7BUUID%7D")
Expand Down
2 changes: 1 addition & 1 deletion static/bidder-info/dmx.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
maintainer:
email: "steve@districtm.net"
email: "prebid@districtm.net"
capabilities:
site:
mediaTypes:
Expand Down
16 changes: 14 additions & 2 deletions static/bidder-params/dmx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@
"type": "string",
"description": "Represent boost MemberId from districtm UI"
},
"placement_id" : {
"type": "string",
"description": "memberid replacement / alternative value or equivalent"
},
"seller_id" : {
"type": "string",
"description": "Represent DMX Partner when you get onboarded, this is for specific setup BURL vs NURL"
},
"dmxid": {
"type": "string",
"description": "Represent the placement ID dmxid equivalent to 'tagid', this value is optional"
},
"tagid": {
"type": "string",
"description": "Represent the placement ID, this value is optional"
"description": "Represent the placement ID tagid equivalent to 'dmxid', this value is optional"
},
"bidfloor": {
"type": "string",
"type": "number",
"description": "The minimum price acceptable for a bid"
}
},
Expand Down