-
Notifications
You must be signed in to change notification settings - Fork 5
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
UOE-11098: Pass user.ext.sessionduration and user.ext.impdepth ORTB request to OW partners #918
base: ci
Are you sure you want to change the base?
Conversation
…e not consuming PublisherID Configured at Partner Account Level (#885)
…rap module (#874) * OTT-1807: discard emptyVAST and invalidVAST bids
OTT-1824: using fastxml for video event injection
…jetc from the signal regs.ext (#893)
Downmerge Master to Ci
RE-3733: Release 12th_Sept_2024
Downmerge 12th September release
* stat for bid recovery * change buckets * introduce new stat
…equest to OW partners
…ider positive value
// ORTBUserExtSessionDuration will read and set ortb User.Ext.sessionduration parameter | ||
func (o *OpenRTB) ORTBUserExtSessionDuration() (err error) { | ||
valStr, ok := o.values.GetString(ORTBUserExtSessionDuration) | ||
if !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can change this to
if !ok || valStr == ""{ returned nil }
} | ||
} | ||
|
||
if valStr != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this check and move it in the first if block?
} | ||
userExt := map[string]interface{}{} | ||
if o.ortb.User.Ext != nil { | ||
err = json.Unmarshal(o.ortb.User.Ext, &userExt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err = json.Unmarshal(o.ortb.User.Ext, &userExt); err != nil {
return
}
func (o *OpenRTB) ORTBUserExtImpDepth() (err error) { | ||
valStr, ok := o.values.GetString(ORTBUserExtImpDepth) | ||
if !ok { | ||
return | ||
} | ||
if o.ortb.User == nil { | ||
o.ortb.User = &openrtb2.User{} | ||
} | ||
userExt := map[string]interface{}{} | ||
if o.ortb.User.Ext != nil { | ||
err = json.Unmarshal(o.ortb.User.Ext, &userExt) | ||
if err != nil { | ||
return | ||
} | ||
} | ||
if valStr != "" { | ||
val, err := strconv.ParseUint(valStr, 10, 64) | ||
if err != nil { | ||
logger.Warn("Invalid imp depth value '%v': %v", valStr, err) | ||
return nil | ||
} | ||
userExt[ORTBExtImpDepth] = int64(val) | ||
} | ||
|
||
data, err := json.Marshal(userExt) | ||
if err != nil { | ||
return | ||
} | ||
|
||
o.ortb.User.Ext = data | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above
@@ -48,7 +49,15 @@ func UpdateUserEidsWithValidValues(user *openrtb2.User) { | |||
if err != nil { | |||
return | |||
} | |||
if userExt.SessionDuration < 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the type of SessionDuration
and ImpDepth
to uint
instead of having these checks?
1eadcd8
to
bcc32d1
Compare
Code coverage summaryNote:
vastbidderRefer here for heat map coverage report
|
Pass user.ext.sessionduration and user.ext.impdepth ORTB request to OW partners