Skip to content

Commit b3a6ea3

Browse files
documentation for getUserIdsAsEids (prebid#1938)
1 parent 1040c8c commit b3a6ea3

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

dev-docs/modules/userId.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,31 @@ If you need to export the user IDs stored by Prebid User ID module, the `getUser
846846
pbjs.getUserIds() // returns object like bidRequest.userId. e.g. {"pubcid":"1111", "tdid":"2222"}
847847
```
848848

849+
You can use `getUserIdsAsEids()` to get the user IDs stored by Prebid User ID module in ORTB Eids format. Refer [eids.md](https://github.com/prebid/Prebid.js/blob/master/modules/userId/eids.md) for output format.
850+
```
851+
pbjs.getUserIdsAsEids() // returns userIds in ORTB Eids format. e.g.
852+
[
853+
{
854+
source: 'pubcid.org',
855+
uids: [{
856+
id: 'some-random-id-value',
857+
atype: 1
858+
}]
859+
},
860+
861+
{
862+
source: 'adserver.org',
863+
uids: [{
864+
id: 'some-random-id-value',
865+
atype: 1,
866+
ext: {
867+
rtiPartner: 'TDID'
868+
}
869+
}]
870+
}
871+
]
872+
```
873+
849874
## Passing UserIds to Google Ad Manager for targeting
850875

851876
User IDs from Prebid User ID module can be passed to GAM for targeting in Google Ad Manager or to pass ahead in Google Exchange Bidding using ```userIdTargeting``` module. More details can be found [here](https://github.com/prebid/Prebid.js/blob/master/modules/userIdTargeting.md). In short, you just need to add the optional userIdTargeting sub-module into your `gulp build` command and the additional `userIdTargeting` config becomes available.

dev-docs/publisher-api-reference.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Functions added by optional modules
7373
* [.adServers.dfp.buildAdpodVideoUrl(options)](#module_pbjs.adServers.dfp.buildAdpodVideoUrl) - requires [GAM Video Module](/dev-docs/modules/dfp_video.html) <span style="color:red" markdown="1">[Alpha]</span>
7474
* [.adServers.freewheel.getTargeting(options)](#module_pbjs.getTargeting) - requires [Freewheel Module](/dev-docs/modules/freewheel.html)
7575
* [.getUserIds()](#userId.getUserIds) - requires [User Id Module](/dev-docs/modules/userId.html)
76+
* [.getUserIdsAsEids()](#userId.getUserIdsAsEids) - requires [User Id Module](/dev-docs/modules/userId.html)
7677

7778
<a name="module_pbjs.getAdserverTargeting"></a>
7879

@@ -506,6 +507,41 @@ pbjs.getUserIds() // returns object like bidRequest.userId. e.g. {"pubcid":"1111
506507

507508
<hr class="full-rule">
508509

510+
<a name="userId.getUserIdsAsEids"></a>
511+
512+
### pbjs.getUserIdsAsEids() ⇒ Object
513+
514+
{: .alert.alert-info :}
515+
To use this function, include the [UserId module](/dev-docs/modules/userId.html) in your Prebid.js build.
516+
517+
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](https://github.com/prebid/Prebid.js/blob/master/modules/userId/eids.md).
518+
519+
```
520+
pbjs.getUserIdsAsEids() // returns userIds in ORTB Eids format. e.g.
521+
[
522+
{
523+
source: 'pubcid.org',
524+
uids: [{
525+
id: 'some-random-id-value',
526+
atype: 1
527+
}]
528+
},
529+
530+
{
531+
source: 'adserver.org',
532+
uids: [{
533+
id: 'some-random-id-value',
534+
atype: 1,
535+
ext: {
536+
rtiPartner: 'TDID'
537+
}
538+
}]
539+
}
540+
]
541+
```
542+
543+
<hr class="full-rule">
544+
509545
<a name="module_pbjs.getNoBids"></a>
510546

511547
### pbjs.getNoBids() ⇒ `Array`

0 commit comments

Comments
 (0)