Skip to content

Commit

Permalink
pubmatic: Pass imp.ext.gpid to SSP
Browse files Browse the repository at this point in the history
  • Loading branch information
AvinashKapre committed May 8, 2024
1 parent 8cce68a commit 77e15a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions adapters/pubmatic/pubmatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type ExtImpBidderPubmatic struct {
adapters.ExtImpBidder
Data json.RawMessage `json:"data,omitempty"`
AE int `json:"ae,omitempty"`
GpId string `json:"gpid,omitempty"`
}

type ExtAdServer struct {
Expand Down Expand Up @@ -78,6 +79,7 @@ const (
AdServerGAM = "gam"
AdServerKey = "adserver"
PBAdslotKey = "pbadslot"
gpIdKey = "gpid"
)

func (a *PubmaticAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
Expand Down Expand Up @@ -319,6 +321,10 @@ func parseImpressionObject(imp *openrtb2.Imp, extractWrapperExtFromImp, extractP
extMap[ae] = bidderExt.AE
}

if bidderExt.GpId != "" {
extMap[gpIdKey] = bidderExt.GpId
}

imp.Ext = nil
if len(extMap) > 0 {
ext, err := json.Marshal(extMap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"rugby",
"cricket"
]
}
},
"gpid":"/1111/home"
}
}
],
Expand Down Expand Up @@ -68,7 +69,8 @@
},
"ext": {
"dfp_ad_unit_code": "/1111/home",
"key_val": "k1=v1|k2=v2|sport=rugby,cricket"
"key_val": "k1=v1|k2=v2|sport=rugby,cricket",
"gpid":"/1111/home"
}
}
],
Expand Down

0 comments on commit 77e15a6

Please sign in to comment.