Integrate with Yahoo ConnectID: JavaScript Method
  • 3 Minutes to read

    Integrate with Yahoo ConnectID: JavaScript Method


      Article summary

      Publishers need a privacy-centric solution to bridge the identity gap while continuing to generate revenue amidst the changes in signal loss and privacy regulations due to the ongoing evolution of the identity landscape. Built on the robust and proprietary Yahoo Identity Graph, Yahoo ConnectID is a future-proofed solution designed to enable ad tech platforms to consistently recognize and match users across the open web.

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

      Integration

      • 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 asynchronously fetch a ConnectID and cache the response

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

      Yahoo ConnectID Registration

      A Yahoo-supplied publisher-specific pixel ID is required. Reach out to [email protected] for assistance with setup.

      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

      2. 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

      3. 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 extra space before hashing.
         puid: …, // (optional) a domain-specific user identifier such as a first-party cookie. If not passed, a puid value will be auto-generated and stored in local and / or cookie storage. 
        };
        
        
        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.

      4. Include Yahoo ConnectID on ad requests via Prebid user identity module.

        pbjs.setConfig({
            userSync: {
                userIds: [{
                    name: "connectId",
        	      value: {
        		   connectId: "example-value"
                    }
                }]
            }
        })

      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 CPRA) 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.


      Was this article helpful?