Publisher Common ID Module

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 Publisher Common ID will be able to pick up the user ID and return it for additional server-side cross device tracking.

Page integration

Simply include the module in your build and it’s automatically enabled. Adapters that support this feature will be able to retrieve the ID and incorporate it in their requests.

Optional configuration

Add a pubcid object in the setConfig() call.

Param Type Description Example
enable boolean Enable or disable the module. Setting it to false will disable the module without having to remove it from the bundle. Default is true. true
expInterval decimal Expiration interval of the cookie in minutes. Default is 2628000, or 5 years. 525600

Example: Changing ID expiration to 1 year

     var pbjs = pbjs || {};
     pbjs.que = pbjs.que || [];
     pbjs.que.push(function() {
        pbjs.setConfig({pubcid: {expInterval: 525600}});

Build the package

Step 1: Bundle the module code

Follow the basic build instructions on the Github repo’s main README. To include the module, an additional option must be added to the the gulp build command:

gulp build --modules=pubCommonId,bidAdapter1,bidAdapter2

Step 2: Publish the package(s) to the CDN

After testing, get your javascript file(s) out to your Content Delivery Network (CDN) as normal.

Note that there are more dynamic ways of combining these components for publishers or integrators ready to build a more advanced infrastructure.

Adapter integration

Adapters should look for bid.crumbs.pubcid in buildRequests() method.

      "sizes":[[300, 250], [300,600]],

Technical Details

  • The ID is UUID v4 and stored as a cookie called _pubcid in the page’s domain.
  • This module hooks into the pbjs.requestBids() method. When invoked, it retrieves the cookie, updates the expiration time, and decorates the adUnits objects. A new cookie will be created if one doesn’t exist already.
  • Beware that if prebid.js is included in an ad server frame, then the ID would have ad server domain instead.