Using External IDs with Consent Manager

  • Updated

Consent Records and External IDs

Setting External IDs

An external user ID can be assigned to a consent record at runtime by leveraging the Osano JavaScript API. This external user ID can then be used to look up consent records in the Osano Web Application or to store and retrieve consent across devices..

⚠️ User data is used exclusively for Cross-Device Consent. Your configuration must have this feature enabled for it to work. Otherwise, setting it does nothing and it will always return an empty string.

If Cross-Device Consent is enabled, user data may be used to store and retrieve consent across devices. In order for this to work it must be set to a user identifier, something unique and consistent for each user. The value is stored locally on a user’s device along with their consent. Before being recorded, it is one-way hashedThe raw value is never sent to Osano’s servers and cannot be retrieved by Osano.

When setting userData, the value may be either a string or a number. Numbers will be converted to string values automatically. The value must be 128 characters or fewer.


Example: = abc123;
// 'abc123'

The setter allows you to assign a custom external ID to a consent record. 

The setter is used in conjunction with an Osano event listener and the osano-cm-initialized event to assign an external user ID to a consent record. Additional JavaScript API documentation can be found here.'osano-cm-initialized', function(){ = 'abc123'; });

⚠️ Caution: do not use this capability in a way that will take you out of compliance with privacy laws and regulations.

To validate abc123 is assigned to consent record:

  1. navigate to the Network tab within Developer Tools, 
  2. Select “Record”
  3. Select Request
  4. Ensure the value for key “extUsrData” is correct.


Searching for Consent Records

To search for a consent record using an External Identifier:

  1. Navigate to
  2. Select Consent Management
  3. Navigate to the Consent Records tab and click the search icon.
  4. Search for a specific consent record using an external ID