Back to Publisher API Reference

pbjs.getUserIdsAsEids()

To use this function, include the UserId module in your Prebid.js build.

If you need to export the user IDs stored by Prebid User ID module in ORTB Eids frormat, then the getUserIdsAsEids() function will return an array formatted as per ORTB Eids.

pbjs.getUserIdsAsEids() // returns userIds in ORTB Eids format. e.g.
[
  {
      source: 'pubcid.org',
      uids: [{
          id: 'some-random-id-value',
          atype: 1
      }]
  },

  {
      source: 'adserver.org',
      uids: [{
          id: 'some-random-id-value',
          atype: 1,
          ext: {
              rtiPartner: 'TDID'
          }
      }]
  }
]

Back to Publisher API Reference