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

UserID: allow any contents in EIDs #12651

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

dgirardi
Copy link
Collaborator

@dgirardi dgirardi commented Jan 13, 2025

Type of change

  • Feature

Description of change

This allows ID modules to provide a single EID generation function instead of current mix (getValue, getUidExt, etc), which in turn also enables them to fill in some currently unsupported fields (inserter, matcher and mm).

The function is passed two arguments (values, config) and should return one or more EID objects. values is an array with IDs as returned by the submodule's decode, and config is the module's configuration.

For example, a definition like

'lipb': {
getValue: function(data) {
return data.lipbid;
},
source: 'liveintent.com',
atype: 3,
getEidExt: function(data) {
if (Array.isArray(data.segments) && data.segments.length) {
return {
segments: data.segments
};
}
}
},

could be translated like so:

    libp(values) {
        return values.map(data => {
            const eid = {
                source: 'liveintent.com',
                uids: [{
                    id: data.libpid,
                    atype: 3
                }]
            }
            if (Array.isArray(data.segments) && data.segments.length) {
                eid.ext = {
                    segments: data.segments
                }
            }
            return eid;
        })
    }

Other information

Related to #12641

@patmmccann patmmccann merged commit f499398 into prebid:master Jan 14, 2025
6 checks passed
@patmmccann patmmccann self-assigned this Jan 14, 2025
therevoltingx pushed a commit to InteractiveAdvertisingBureau/Prebid.js that referenced this pull request Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants