prebid-server icon indicating copy to clipboard operation
prebid-server copied to clipboard

Drop the User EID object if the all the ID values are empty

Open Pubmatic-Supriya-Patil opened this issue 6 months ago • 2 comments

Prebid Server has validation on the user EIDS object where User.Id is a required field. There can be situations where the publisher has set a macro in the GAM tag for the User.Id field. For some requests, it's possible that this macro value is missing. Instead of returning a bad request, we can add a check to remove the Id field if it is not present. Example Valid EID:[{"source":"uidapi.com","uids":[{"id":"AgAACYa0cG2jcVcM42xG"}]}] Invalid EID: [{"source":"uidapi.com","uids":[{"id":""}]}] So with this, problem is like if we have mix of valid and invalid id's for same source then its returning invalid request. Example: [{"source":"uidapi.com","uids":[{"id":""}, {"id":"AgAACYa0cG2jcVcM42xG"}]}, {"source":"liveramp.com","uids":[{"id":"AgAACYa0cG2jcVcM42xG"}]}, {"source":"yahoo.com","uids":[{"id":""},{"id":""}]}]

Here expectation is like valid id's should get considerd and invalid Id's can be dropped.

Example: [{"source":"uidapi.com","uids":[{"id":""}, {"id":"AgAACYa0cG2jcVcM42xG"}]}, {"source":"liveramp.com","uids":[{"id":"AgAACYa0cG2jcVcM42xG"}]}, {"source":"yahoo.com","uids":[{"id":""},{"id":""}]}]

After adding new logic to drop invalid ID's it should return valid ID's only like below

[{"source":"uidapi.com","uids":[{"id":"AgAACYa0cG2jcVcM42xG"}]}{"source":"liveramp.com","uids":[{"id":"AgAACYa0cG2jcVcM42xG"}]}]

If No valid id present then drop complete EIDS object Example: [{"source":"uidapi.com","uids":[{"id":""}]}]

Pubmatic-Supriya-Patil avatar Aug 14 '24 08:08 Pubmatic-Supriya-Patil