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

AdView: support multi imps request & formattype tag for bid response #3355

Merged
merged 44 commits into from
Feb 6, 2024

Conversation

AdviewOpen
Copy link
Contributor

  1. support multi imps from request.
  2. add formattype tag for bid response, use this to handle resp bid-type.

// setting "banner" as the default bid type
bidType := openrtb_ext.BidTypeBanner
if bidExt != nil {
switch bidExt.BidType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, do you mean in line 203, bidType set to banner default type is not suitable, so I should return error if no matched bidtype, right?
Or you mean I should set Mtype such as "seatBid.Bid[i].MType = openrtb2.MarkupBanner" in MakeBids()?
Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Sonali-More-Xandr So, you mean is I can use the following codes to get the bid type is enough?
func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
switch bid.MType {
case openrtb2.MarkupBanner:
return openrtb_ext.BidTypeBanner, nil
case openrtb2.MarkupVideo:
return openrtb_ext.BidTypeVideo, nil
case openrtb2.MarkupNative:
return openrtb_ext.BidTypeNative, nil
default:
return "", fmt.Errorf("Unable to fetch mediaType in: %s", bid.ImpID)
}
}

Copy link

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, 188fcfc

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForImp	0.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:181:	getMediaTypeForBid	81.8%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:201:	getBidType		87.5%
total:									(statements)		75.0%

Copy link

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, ed5fec3

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForImp	0.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:181:	getMediaTypeForBid	66.7%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:197:	getBidType		0.0%
total:									(statements)		65.9%

@AdviewOpen
Copy link
Contributor Author

Based on reviews, and I got the confirmation that adview server already support mtype in response, after test, i change getMediaTypeForBid(), pls review it.
Thanks.

Comment on lines 192 to 193
return "", fmt.Errorf("Unable to fetch mediaType in multi-format: %s", bid.ImpID)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@AdviewOpen should also add received mType in error case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, add it.

Copy link

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, 1d0d0f9

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForImp	0.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:181:	getMediaTypeForBid	66.7%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:197:	getBidType		0.0%
total:									(statements)		65.9%

2.remove unused codes.
Copy link

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, d68ca53

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForBid	66.7%
total:									(statements)		81.1%

Copy link

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, 21372b8

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForBid	66.7%
total:									(statements)		81.1%

@AdviewOpen
Copy link
Contributor Author

Hi, I add mtype in error output & removed no used codes.
pls check it and thx.

return openrtb_ext.BidTypeBanner, nil
case openrtb2.MarkupVideo:
return openrtb_ext.BidTypeVideo, nil
case openrtb2.MarkupAudio:
Copy link
Contributor

Choose a reason for hiding this comment

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

as per adview bidder-info yml, audio media type is not supported. should remove audio case

mediaTypes:
- banner
- native
- video

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the reminder, fixed.

Copy link

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, 2711af5

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForBid	66.7%
total:									(statements)		81.1%

Copy link

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, 57af4f6

adview

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/adview/adview.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:39:	MakeRequests		74.4%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:114:	MakeBids		90.9%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:161:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v2/adapters/adview/adview.go:166:	getMediaTypeForBid	80.0%
total:									(statements)		82.2%

@AdviewOpen
Copy link
Contributor Author

Remove audio type cause not supporting now. thx.

@bsardo
Copy link
Collaborator

bsardo commented Feb 1, 2024

@AdviewOpen I didn't see a docs PR; can you open one please? Your documentation currently states that your adapter doesn’t support multi impression and can not perform impression splitting, so only the first impression will be delivered.

https://github.com/prebid/prebid.github.io/blob/5b17a6f67927ac955d9bda241bd0ec2c19fb7435/dev-docs/bidders/adview.md?plain=1#L25

@AdviewOpen
Copy link
Contributor Author

We have update the doc PR #5126, Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants