SharedID
| Module | sharedIdSystem |
|---|---|
| EID Source | sharedid.org |
| bidRequest.userId | sharedid |
| Example | {"id":"01EAJWWN...", "third":"01EAJ..."} |
This module stores an unique user id in the first party domain and makes it accessible to all adapters. Similar to IDFA and AAID, this is a simple UUID that can be utilized to improve user matching, especially for iOS and MacOS browsers, and is compatible with ITP (Intelligent Tracking Prevention). It’s lightweight and self contained. Adapters that support SharedId will be able to pick up the user ID and return it for additional server-side cross device tracking.
There is no special registration or configuration for SharedID. Each publisher’s privacy policy should take SharedID into account. Prebid recommends implementing a method where users can easily opt-out of targeted advertising. Please refer to the User Opt-Out section located at the bottom of this page. For more information check out Prebid’s dedicated identity page
Add it to your Prebid.js package with:
gulp build --modules=sharedIdSystem
SharedID ID Configuration
In addition to the parameters documented above in the Basic Configuration section the following SharedID specific configuration is available:
| Param under userSync.userIds[] | Scope | Type | Description | Example |
|---|---|---|---|---|
| name | Required | String | The name of this module. | 'sharedId' |
| params | Optional | Object | Customized parameters | |
| params.create | Optional | Boolean | For publisher server support only. If true, the publisher’s server will create the (pubcid) cookie. Default is true. | true |
| params.pixelUrl | Optional | String | For publisher server support only. Where to call out to for a server cookie – see Prebid Identity for more information. | /wp-json/pubcid/v1/extend/ |
| params.pixelConsent | Optional | Boolean | For publisher server support only. If true, the pixelUrl request also carries the page’s consent data, so the endpoint can decide on storage with the same consent as Prebid.js. See Sending consent to the pixelUrl endpoint. Default is false. Since Prebid.js 11.52. |
true |
| params.pixelCookieDomain | Optional | Boolean | For publisher server support only. If true, the pixelUrl request also carries cookie_domain, the domain Prebid.js writes the ID cookie on, so the endpoint can set its cookie on the same domain. See Sending the cookie domain to the pixelUrl endpoint. Default is false. Since Prebid.js 11.52. |
true |
| params.extend | Optional | Boolean | If true, the expiration time of the stored IDs will be refreshed during each page load. Default is false. | false |
| storage | Required | Object | The publisher must specify some kind of local storage in which to store the results of the call to get the user ID. This can be either cookie or HTML5 storage. | |
| storage.expires | Integer | Required | How long the user ID information will be stored. | 365 |
| storage.name | String | Required | The name of the cookie or html5 local storage where the user ID will be stored. | _pubcid |
| storage.type | String | Required | This is where the results of the user ID will be stored. Must be either: Must be either: “cookie” or “html5”. For server side implementations, which have the best identifier life and revenue impact, this must be a cookie. | cookie |
Sending consent to the pixelUrl endpoint
Since Prebid.js 11.52, params.pixelConsent: true adds the page’s consent data to the pixelUrl request, both when an ID is created and when it is extended. A pixelUrl endpoint sets and deletes the ID cookie itself, so it needs to decide on consent too. Without these parameters it has to find the consent on its own, for example from a CMP cookie, which may be missing or out of date.
The request keeps its id=pubcid:<id> parameter and adds, each only when the consent data is available:
| Query parameter | Value |
|---|---|
gdpr |
1 if GDPR applies, 0 if it doesn’t; left out when that is unknown |
gdpr_consent |
The TCF consent string |
us_privacy |
The US Privacy (CCPA) string |
gpp |
The GPP string |
gpp_sid |
The applicable GPP section IDs, comma-separated |
Values are URL-encoded, for example:
/wp-json/pubcid/v1/extend/?id=pubcid%3A<id>&gdpr=1&gdpr_consent=<TC string>&gpp=DBABMA~<TC string>&gpp_sid=2%2C7
Without pixelConsent, the request is unchanged.
Sending the cookie domain to the pixelUrl endpoint
Since Prebid.js 11.52, params.pixelCookieDomain: true adds cookie_domain to the pixelUrl request, both when an ID is created and when it is extended. Its value is the domain Prebid.js writes the ID cookie on: the topmost domain the browser accepts a cookie for, found by writing test cookies (for example example.com on www.example.com). A server can’t run that check itself, so with this parameter a first-party endpoint can set its cookie with the same Domain as Prebid.js. The endpoint should only accept a value that equals the request host or is a parent domain of it (ending in . plus the value), and ignore anything else.
cookie_domain is left out when no domain can be determined, for example when cookies can’t be written. The test cookies are only written when this parameter is set. It works with or without pixelConsent:
/wp-json/pubcid/v1/extend/?id=pubcid%3A<id>&us_privacy=1YNN&cookie_domain=example.com
Without pixelCookieDomain, the request is unchanged.
SharedID Examples
-
Publisher supports SharedID and first party domain cookie storage
pbjs.setConfig({ userSync: { userIds: [{ name: "sharedId", storage: { type: "cookie", name: "_sharedid", // create a cookie with this name expires: 365 // expires in 1 years } }] } }); -
Publisher supports both UnifiedID and SharedID and first party domain cookie storage
pbjs.setConfig({ userSync: { userIds: [{ name: "unifiedId", params: { partner: "myTtdPid" }, storage: { type: "cookie", name: "pbjs-unifiedid", // create a cookie with this name expires: 60 } },{ name: "sharedId", params: { pixelUrl: "/wp-json/pubcid/v1/extend/" }, storage: { type: "cookie", name: "_sharedid", // create a cookie with this name expires: 180 } }], syncDelay: 5000 // 5 seconds after the first bidRequest() } }); -
Publisher supports SharedID and first party domain cookie storage initiated by a first party server
pbjs.setConfig({ userSync: { userIds: [{ name: "sharedId", params: { pixelUrl: "/wp-json/pubcid/v1/extend/", //pixelUrl should be specified when the server plugin is used pixelConsent: true, // optional: send the page's consent data with the pixelUrl request pixelCookieDomain: true // optional: send the domain Prebid.js writes the cookie on }, storage: { type: "cookie", name: "_sharedid", // create a cookie with this name expires: 365 // expires in 1 year } }] } });