Skip to content

UOE-12502: Disable country level filtering for adUnits onboarded in MBMF Phase 1 #1090

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Pubmatic-Supriya-Patil
Copy link
Collaborator

Description

Please add change description or link to ticket, docs, etc.

Checklist:

  • PR commit list is unique (rebase/pull with the origin branch to keep master clean).
  • JIRA number is added in the PR title and the commit message.
  • Updated the header-bidding repo with appropiate commit id.
  • Documented the new changes.

For Prebid upgrade, refer: https://inside.pubmatic.com:8443/confluence/display/Products/Prebid-server+upgrade

@@ -613,8 +613,10 @@ func (m OpenWrap) getMultiFloors(rctx models.RequestCtx, reward *int8, imp openr
return nil
}

if !m.pubFeatures.IsMBMFCountry(rctx.DeviceCtx.DerivedCountryCode) {
return nil
if !m.pubFeatures.IsPubIdMBMFPhase1Enabled(rctx.PubID) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add UT for this ?

glog.Warning("MBMF is not enabled for pubid: %s, country: %s IID = %s", rctx.PubID, rctx.DeviceCtx.DerivedCountryCode, rctx.LoggerImpressionID)
m.metricEngine.RecordMBMFRequests(rctx.PubIDStr, 1)
return nil
}
}

//if pub entry present with is_enabled=1 AND no pub in mbmf_enabled wrapper_feature-> apply mbmf
//if pub entry present as is_enabled=0 -> don't apply mbmf
if !m.pubFeatures.IsMBMFPublisherEnabled(rctx.PubID) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Pubmatic-Supriya-Patil : Here when pub is not enabled for mbmf, how are we logging it as mbmfrequest?

@@ -628,6 +633,7 @@ func (m OpenWrap) getMultiFloors(rctx models.RequestCtx, reward *int8, imp openr
adunitFormat := getAdunitFormat(reward, imp)
//don't apply mbmf if pub is not enabled for adunitFormat
if adunitFormat != "" && !m.pubFeatures.IsMBMFEnabledForAdUnitFormat(rctx.PubID, adunitFormat) {
m.metricEngine.RecordMBMFRequests(rctx.PubIDStr, 3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Pubmatic-Supriya-Patil : move constant numbers to variables. This will make code more readable

return nil
}
m.metricEngine.RecordMBMFRequests(rctx.PubIDStr, 0)
return multifloors
}
//fallback to adunitformat multifloors if adunitlevel floors not present in DB
}

if adunitFormat != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Pubmatic-Supriya-Patil : add comment mentioning, ad unit level MBMF not found. Hence, looking up at adformat level

Comment on lines 2235 to 2236
mockFeature.EXPECT().IsMBMFCountry("IN").Return(false)
mockFeature.EXPECT().IsPubIdMBMFPhase1Enabled(5890).Return(false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Pubmatic-Supriya-Patil : checks are not arranged in logical order. It's not making code readable.

  1. publevel
  2. countrylevel

@Pubmatic-Supriya-Patil Pubmatic-Supriya-Patil changed the title Disable country level filtering for adUnits onboarded in MBMF Phase 1 UOE-12502: Disable country level filtering for adUnits onboarded in MBMF Phase 1 May 31, 2025
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.

3 participants