Skip to content

Commit

Permalink
Using pdadslot field for populating dfp_ad_unit_code
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin-pubmatic committed Jun 9, 2021
1 parent c74f400 commit b017ddc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions adapters/pubmatic/pubmatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,12 @@ func parseImpressionObject(imp *openrtb2.Imp, wrapExt *string, pubID *string) er
extMap[pmZoneIDKeyName] = pubmaticExt.PmZoneID
}

if bidderExt.Data != nil && bidderExt.Data.AdServer != nil &&
bidderExt.Data.AdServer.Name == AdServerGAM && bidderExt.Data.AdServer.AdSlot != "" {
extMap[ImpExtAdUnitKey] = bidderExt.Data.AdServer.AdSlot
if bidderExt.Data != nil {
if bidderExt.Data.AdServer != nil && bidderExt.Data.AdServer.Name == AdServerGAM && bidderExt.Data.AdServer.AdSlot != "" {
extMap[ImpExtAdUnitKey] = bidderExt.Data.AdServer.AdSlot
} else if bidderExt.Data.PBAdSlot != "" {
extMap[ImpExtAdUnitKey] = bidderExt.Data.PBAdSlot
}
}

imp.Ext = nil
Expand Down
1 change: 1 addition & 0 deletions openrtb_ext/imp.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type ExtStoredRequest struct {

type ExtData struct {
AdServer *ExtAdServer `json:"adserver"`
PBAdSlot string `json:"pbadslot"`
}

type ExtAdServer struct {
Expand Down

0 comments on commit b017ddc

Please sign in to comment.