Integrate with ConnectID: JavaScript Method

The Yahoo ConnectID is designed to enable ad tech platforms to recognize and match users consistently across the open web. ConnectID is built on top of the robust and proprietary Yahoo ID Graph and enables publishers to thrive in the cookieless world.

This module is one method of integrating with Yahoo ConnectID and is compatible with all major browsers and IE11.


  • The publisher calls the getIds() function

  • The module immediately responds with a locally cached ConnectID (when available). If the ConnectID is not locally cached or has not been fetched recently, the module uses the ConnectID API to fetch a ConnectID and caches the response

  • The publisher passes the ConnectID to the ad server in an ad request

Integration Steps

  1. Install the module into the project using node package manager (npm) by running the following command in the terminal.

npm install @yahoo/yahoo-connectid

  1. Add either the ES6 or ES5 module into the src directory and dist directory.
  • ES5 - (ECMAScript 5) is a version of javascript supported by older browsers and IE11. Publishers who want broader browser compatibility may want to use ES5. The ES5 module is larger because it includes code that supports older browsers.

    Import connectId from @yahoo/yahoo-connectid

  • ES6 - (ECMAScript 6) is a version of javascript supported by modern browsers (but not IE11). ES6 is also a good choice if it is already used in your source code and one of the commonly used transpilers is available to convert ES6 to ES5.

    Import connectId from @yahoo/yahoo-connectid/src/connectid

  1. Get the Yahoo ConnectID by adding the following into the source code and running it on the first party domain of the website.

// code running on a first party domain ...

const params = {

pixelId: ..., // publisher specific pixel id

email: ..., // (optional) raw or SHA-256 hashed email. Email must be lowercase and trimmed of white space before hashing.

puid: ..., // (optional) raw or SHA-256 hashed publisher user id.


const callback = ids => {

// ids is a map of id type to value, for example {connectid: 'abc123'}

// pass ids.connectid in request to ad server


connectId.getIds(params, callback);

If a raw email is provided then a SHA-256 hash of the raw email will be used for syncing and local storage. The raw email is never stored.

To integrate with ConnectID using the JavaScript Module, visit our Github repository.

  1. Include the Yahoo ConnectID on ad requests by passing the value as a key-value pair in the admax_vars dictionary.

<script src=""></script>


var admax_vars = {

"dcn": "siteId"

,"pos": "placementId"

,"secure": "1"

,"": "ConnectId"






Honoring Privacy Choices

Yahoo ConnectID provides multiple mechanisms for users to manage their privacy choices. Users can manage their choices via ConnectID Control Portal, on the Yahoo Privacy Dashboard and NAI’s Audience Matched Opt Out page. No further actions are required by Publishers as Yahoo will ensure that privacy choices selected by users via one of these methods are honored. We will automatically stop generating ConnectIDs for users who have opted-out.

When desired, additional privacy control can be provided to your users. Within your privacy policy or website privacy settings, Create an Easy Opt-in Opt-out Toggle for ConnectID.

Finally, ConnectID follows all global privacy laws (such as the CCPA) and industry frameworks (such as NAI, DAA and IAB). Yahoo will auto-detect most privacy signals present on the page (including those set by prebid libraries) and not generate a ConnectID for users that have opted-out.