Prebid.js: add sharedid user id to pubcommon

Created on 17 Sep 2020  路  5Comments  路  Source: prebid/Prebid.js

Type of issue

feature

Description

We would like to add functionality to the existing Pubcommon user id module. Specifically we would like the Pubcommon module to check for the presence of the Sharedid.org cookie, and if found pass that value on to bidders in a new object.

If not found we would like the Pubcommon userid module to init a call to https://id.sharedid.org/usync. This endpoint sets a UUID in a sharedid.org cookie. That value would then be used in subsequent auctions.

Expected results

{
   id:string(pubcid),
   sharedid:string(sharedid)
}

Actual results

NA

Platform details

4.10 and above

Other information

Most helpful comment

It turns out no bidder change is needed. It's possible to keep pubcid and sharedid separated in the two collections. Please see #5850. The output will look something like this instead:

bidRequest.userId = {"pubcid":"13078311-d73e-4e4f-8bbc-96f6bf9bd372","sharedid":{"id":"01EMERKWHBXTMNDMDKN5BJ0PYE"};

bidRequest.userIdAsEids = [{"source":"pubcid.org","uids":[{"id":"13078311-d73e-4e4f-8bbc-96f6bf9bd372","atype":1}]},
{"source":"sharedid.org","uids":[{"id":"01EMERKWHBXTMNDMDKN5BJ0PYE","atype":1}]}];

All 5 comments

To support this change, we will be modifying the following bid adapters that refer to bid.userid.pubcid:

adspendBidAdapter.js - @loorke
adxcgBidAdapter.js - @adxcgcom
conversantBidAdapter.js - @pycnvr
districtmDMXBidAdapter.js - @stevealliance , @lsv1
emoteevBidAdapter.js - @piotr-yuxuan
justpremiumBidAdapter.js - @nwlosinski , @mkalafior
livewrappedBidAdapter.js - @bjorn-lw , @barslev
luponmediaBidAdapter.js - @adxpremium , @EfdalMustafic
mobsmartBidAdapter.js - @kpis-msa
openxBidAdapter.js - @jimee02 , @lntho
ozoneBidAdapter.js - @afsheenb
pulsepointBidAdapter.js - @anand-venkatraman, @NoodlesNZ
richaudienceBidAdapter.js - @richaudience
rubiconBidAdapter.js - @harpere , @idettman
smartxBidAdapter.js - @Skylinar
spotxBidAdapter.js - @npeceniak , @codybonney
vidazooBidAdapter.js - @uditalias , @shmoop207
yieldmoBidAdapter.js - @MelodyLi2017 , @HolzAndrew

The plan would be to look at bid.userId.pubcid and allow it to be _either_ a string or an object. If it's string, treat it exactly the way you do now. If it's an object, pull out the pubcid attribute and use that value however you're using the current string.

If you would prefer to do this yourself, or if you'd like to build in support for sharedid at the same time, let us know that you'll be submitting your own PR.

Does this sound about right?

Bid Adapter Changes

Current Behavior

During an auction, the user id module collects IDs from submodules, and presents them to the bidders in two collections. For instance, with only pubCommonId enabled, the collections look like the following:

bidRequest.userId = { "pubcid": "b72fb417-123e-41e5-95bf-0057949d14d6" };

bidRequest.userIdAsEids = [{"source":"pubcid.org","uids":[{"id":"340617e9-3270-49d4-926b-1221bf2b3642","atype":1}]}]

Merge with Shared ID

After the merge, the pubcid value in the userId collection will become an object, with a shared id component. While in the eids format, shared id will be added as an extension.

bidRequest.userId = { "pubcid": {"id": "b72fb417-123e-41e5-95bf-0057949d14d6", "sharedid": "01EHASYPH6TT9EC70CSZJAXBF1"}};

bidRequest.userIdAsEids = [{"source":"pubcid.org", 
"uids":[{"id":"340617e9-3270-49d4-926b-1221bf2b3642","atype":1,"ext":{"sharedid":"01EHASYPH6TT9EC70CSZJAXBF1"}}]}];

Migration Required

For adapters that reference userId collection:

  • Change to use utils.deepAccess to fetch userId.pubcid.id instead of userId.pubcid.
  • Each maintainer will decide later how best to forward shared id.

For adapters that reference eids:

  • No change needed

Implementation Notes

Retain previous storage format

@jdwieland8282 @bretg With some re-arrangement of #5709, it's possible to retain the same pubcid storage value, ie: as a uuid string.

  • Keep responses from getId, expandId, and the callback function as uuid.
  • The one place that needs to return composite object is decode.
  • Shared id should still be fetched in the background but needs to be stored directly in the pubcommonid submodule using the storage manager, so that it can be used in subsequent calls.
  • Also note the proposed changed to the composite. To avoid repetition in userId collection, let's just use id.
{
   id:string(pubcid),
   sharedid:string(sharedid)
}

@pycnvr sounds good to me.

@MarkoYerkovichRP fyi..

It turns out no bidder change is needed. It's possible to keep pubcid and sharedid separated in the two collections. Please see #5850. The output will look something like this instead:

bidRequest.userId = {"pubcid":"13078311-d73e-4e4f-8bbc-96f6bf9bd372","sharedid":{"id":"01EMERKWHBXTMNDMDKN5BJ0PYE"};

bidRequest.userIdAsEids = [{"source":"pubcid.org","uids":[{"id":"13078311-d73e-4e4f-8bbc-96f6bf9bd372","atype":1}]},
{"source":"sharedid.org","uids":[{"id":"01EMERKWHBXTMNDMDKN5BJ0PYE","atype":1}]}];

done

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mercuryyy picture mercuryyy  路  5Comments

mthazin picture mthazin  路  6Comments

pm-harshad-mane picture pm-harshad-mane  路  5Comments

dugwood picture dugwood  路  4Comments

whatisjasongoldstein picture whatisjasongoldstein  路  6Comments