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

RTBHouse: native support #3212

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

piotrj-rtbh
Copy link
Contributor

@piotrj-rtbh piotrj-rtbh commented Oct 13, 2023

Type of change

  • Feature
  • Code style update (formatting, local variables)
  • Bugfix

Description of change

Native ads are now available to be processed and accessed by RTB House adapter. Test coverage has increased significantly.

There is also a little bugfix added to how the adapter handles bid floors. Previous version dropped bid floor defined in a bidder param ("bidfloor") when publishers didn't set currency module. Now it is fine with that case and the bidfloor currency is set to the bidder's default (USD).

Other information

Please reach us at [email protected] with [email protected] and cc [email protected].

@github-actions
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, 18c794b

rtbhouse

Refer here for heat map coverage report

github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:28:	Builder			100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:36:	MakeRequests		94.1%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:106:	getImpressionExt	100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:128:	MakeBids		100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:193:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:204:	getNativeAdm		100.0%
total:									(statements)		97.7%

@github-actions
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, 4478925

rtbhouse

Refer here for heat map coverage report

github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:28:	Builder			100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:36:	MakeRequests		94.1%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:106:	getImpressionExt	100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:128:	MakeBids		100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:191:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:202:	getNativeAdm		100.0%
total:									(statements)		97.6%

Comment on lines 197 to 198
default:
return openrtb_ext.BidTypeBanner
Copy link
Contributor

Choose a reason for hiding this comment

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

should not default to banner type. Should return error if found an unknown bid type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@onkarvhanumante Many adapters behave like that by returning banner type as default and/or do not return an error: see aceex, acuityads,adhese just to name a few from the top and even pubmatic and pubnative.

Our bidder may sometimes skip the mtype if the response contains banner data. Such a situation indicates we have to suppose we've got banner data in response.

Our Java adapter works also like the above.

Copy link
Contributor

@onkarvhanumante onkarvhanumante Oct 19, 2023

Choose a reason for hiding this comment

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

@piotrj-rtbh Thanks for the clarifiacation

If bidder skips setting mtype then can fallback to check if imp.Banner is not null and then return openrtb_ext.BidTypeBanner

Our bidder may sometimes skip the mtype if the response contains banner data

Also should add above as comment in adapter code

Copy link
Contributor Author

@piotrj-rtbh piotrj-rtbh Oct 19, 2023

Choose a reason for hiding this comment

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

If bidder skips setting mtype then can fallback to check if imp.Banner is not null and then return openrtb_ext.BidTypeBanner

@onkarvhanumante I didn't get it well. Do you mean I need to loop through request's imp[] array, find matching element (by impid I suppose) and check it's Banner prop if it's null or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

If bidder skips setting mtype then can fallback to check if imp.Banner is not null and then return openrtb_ext.BidTypeBanner

@onkarvhanumante I didn't get it well. Do you mean I need to loop through request's imp[] array, find matching element (by impid I suppose) and check it's Banner prop if it's null or not?

yes for default case to check if banner was set in req.Imp[]. However this may not work if your adapter support multi-format imp

Copy link
Contributor

@gargcreation1992 gargcreation1992 Oct 20, 2023

Choose a reason for hiding this comment

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

I think if you wanna default to Banner then you could use the following code to check the native first and then default to banner.

func getMediaTypeForBid(bid openrtb2.Bid) openrtb_ext.BidType {
	switch bid.MType {
	case openrtb2.MarkupNative:
		return openrtb_ext.BidTypeNative
	default:
		return openrtb_ext.BidTypeBanner
}

The above should work for your adapter. But I strongly recommend that you should change your bidder to properly set MType and not skip that value.

Also mention in the docs that your adapter defaults to BidTypeBanner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@onkarvhanumante @gargcreation1992

We decided to always return MType from the bidder. Just in case the bid type detecting function now may return an error if MType is not supported. Returned bids which have unknown MType are skipped then.

@github-actions
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, 3012d46

rtbhouse

Refer here for heat map coverage report

github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:28:	Builder			100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:36:	MakeRequests		94.1%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:106:	getImpressionExt	100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:128:	MakeBids		100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:194:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/adapters/rtbhouse/rtbhouse.go:205:	getNativeAdm		100.0%
total:									(statements)		97.7%

@onkarvhanumante
Copy link
Contributor

@piotrj-rtbh , prebid server has published major release 2.0.

Requesting to sync with rtbh-lotani:rtbhouse/native-support with latest prebid server master.

@github-actions
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, 2cc2bd1

rtbhouse

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/rtbhouse/rtbhouse.go:28:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/rtbhouse/rtbhouse.go:36:	MakeRequests		94.1%
github.com/prebid/prebid-server/v2/adapters/rtbhouse/rtbhouse.go:106:	getImpressionExt	100.0%
github.com/prebid/prebid-server/v2/adapters/rtbhouse/rtbhouse.go:128:	MakeBids		100.0%
github.com/prebid/prebid-server/v2/adapters/rtbhouse/rtbhouse.go:194:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v2/adapters/rtbhouse/rtbhouse.go:205:	getNativeAdm		100.0%
total:									(statements)		97.7%

@piotrj-rtbh
Copy link
Contributor Author

piotrj-rtbh commented Oct 26, 2023

Requesting to sync with rtbh-lotani:rtbhouse/native-support with latest prebid server master.

@onkarvhanumante Thank you. Fork synced.

@Sonali-More-Xandr Sonali-More-Xandr merged commit 2540dd8 into prebid:master Oct 30, 2023
5 checks passed
bsardo added a commit to bsardo/prebid-server that referenced this pull request Oct 30, 2023
bsardo added a commit that referenced this pull request Oct 30, 2023
@piotrj-rtbh
Copy link
Contributor Author

@bsardo Could you please describe the reason why this PR commit has been reverted?
Native ads support for Java version has been added with this PR: prebid/prebid-server-java#2641 and the automatically created cross-repo issue has been resolved: #3223 where we promised to deliver native ads support for Go version.

svamiftah pushed a commit to sovrn/prebid-server that referenced this pull request Nov 21, 2023
svamiftah pushed a commit to sovrn/prebid-server that referenced this pull request Nov 21, 2023
@bsardo
Copy link
Collaborator

bsardo commented Nov 30, 2023

Hi @piotrj-rtbh, I apologize for the revert and the slow response. It was solely a matter of circumstance. We built v2.0.0 and then realized there was a problem with it so we put up a fix but our team merged this PR before the patch v2.0.1 was built. As a result, we reverted your PR with the intention of remerging it after the patch was built but forgot to do so.

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.

5 participants