Skip to content

Commit

Permalink
Update convert_up.go
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored Feb 19, 2025
1 parent b591ca3 commit 8113bf8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions openrtb_ext/convert_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,31 +168,32 @@ func moveEIDFrom25To26(r *RequestWrapper) {
return
}

// If 2.6 location is present, append only new eids based on 'source'
// If 2.6 location is present, append only new eids based on 'source'.
existingEIDs := r.User.EIDs
for _, eid25 := range *eids25 {
// We only compare if both 'source' fields are non-nil.
// Adjust this if you need special handling for nil sources.
if eid25.Source == nil {
// Example: always append if source is nil:
// If source is empty, decide what to do. Example: always append if empty
if eid25.Source == "" {
existingEIDs = append(existingEIDs, eid25)
continue
}

found := false
for _, eid26 := range existingEIDs {
if eid26.Source != nil && *eid25.Source == *eid26.Source {
// Compare strings directly
if eid25.Source == eid26.Source {
found = true
break
}
}

if !found {
existingEIDs = append(existingEIDs, eid25)
}
}
r.User.EIDs = existingEIDs
}


// moveRewardedFromPrebidExtTo26 modifies the impression to move the Prebid specific
// rewarded video signal (imp[].ext.prebid.is_rewarded_inventory) to the OpenRTB 2.6
// location (imp[].rwdd). If the OpenRTB 2.6 location is already present the Prebid
Expand Down

0 comments on commit 8113bf8

Please sign in to comment.