Skip to content

New Adapter: Optidigital#4287

Merged
bsardo merged 10 commits into
prebid:masterfrom
optidigital-prebid:master
Jun 5, 2025
Merged

New Adapter: Optidigital#4287
bsardo merged 10 commits into
prebid:masterfrom
optidigital-prebid:master

Conversation

@optidigital-prebid
Copy link
Copy Markdown
Contributor

@optidigital-prebid optidigital-prebid commented Apr 2, 2025

This PR introduces the Optidigital bidder adapter for Prebid Server.
Related PR: prebid/prebid.github.io#5976

Maintainer Contact: prebid@optidigital.com

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2025

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, c27f8bd

optidigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/optidigital/optidigital.go:20:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/optidigital/optidigital.go:27:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/optidigital/optidigital.go:43:	MakeBids	94.1%
total:										(statements)	91.7%

Comment thread adapters/optidigital/optidigital.go Outdated
Comment thread adapters/optidigital/optidigital.go Outdated
Comment thread adapters/optidigital/optidigital.go
Comment thread static/bidder-info/optidigital.yaml
Comment thread static/bidder-info/optidigital.yaml
Comment thread static/bidder-info/optidigital.yaml
@ccorbo ccorbo self-assigned this Apr 11, 2025
Comment thread static/bidder-info/optidigital.yaml
@github-actions
Copy link
Copy Markdown

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 8b269ed

optidigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/optidigital/optidigital.go:19:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/optidigital/optidigital.go:26:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/optidigital/optidigital.go:42:	MakeBids	100.0%
total:										(statements)	95.0%

@przemkaczmarek przemkaczmarek self-assigned this May 19, 2025
@przemkaczmarek przemkaczmarek requested review from przemkaczmarek and removed request for pm-jaydeep-mohite May 19, 2025 12:51
Comment on lines +10 to +14
// This file actually intends to test static/bidder-params/optidigital.json
//
// These also validate the format of the external API: request.imp[i].ext.prebid.bidder.optidigital

// TestValidParams makes sure that the optidigital schema accepts all imp.ext fields which we intend to support.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIP: I suggest removing all comments.

Comment on lines +62 to +69
for _, seatBid := range response.SeatBid {
for i := range seatBid.Bid {
bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
Bid: &seatBid.Bid[i],
BidType: openrtb_ext.BidTypeBanner,
})
}
}
Copy link
Copy Markdown
Collaborator

@przemkaczmarek przemkaczmarek May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, it's better to add code like this:

for _, seatBid := range response.SeatBid {
		for i, bid := range seatBid.Bid {
			bidType, err := getMediaTypeForBid(bid)
			if err != nil {
				return nil, []error{err}
			}

			b := &adapters.TypedBid{
				Bid:     &seatBid.Bid[i],
				BidType: bidType,
			}
			bidResponse.Bids = append(bidResponse.Bids, b)
		}
	}
	
	
func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
	switch bid.MType {
	case openrtb2.MarkupBanner:
		return openrtb_ext.BidTypeBanner, nil
	default:
		return "", fmt.Errorf("Unable to fetch mediaType in multi-format: %s", bid.ImpID)
	}
} 

I know that right now you're only using "banner", but in the future You might want to change something, and this approach will make it easier.

@bsardo bsardo merged commit 1a3d88c into prebid:master Jun 5, 2025
6 checks passed
shunj-nb pushed a commit to ParticleMedia/prebid-server that referenced this pull request Jun 13, 2025
prnvgupta pushed a commit to automatad/prebid-server that referenced this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants