CMP JS / CMP UI communication interface

Modal iframe integration

When the CMP requires the user to provide consent, it will load the publisher provided config.uiUrl in an iframe. It will then post a message to the iframe with the following message format.

__cmpUICall: {
   command: 'renderConsentUi',
   parameter: config, // includes the uiCustomParams from in the "init" command
   callId: uniqueId
}


The consent UI should listen for this message, then initialise the UI. Once the user has saved their consent, the consent UI should post a message back to the parent window with the following format.

 

__cmpUIReturn: {
   returnValue: consentString, // bsee64 encoded consent string
   success: boolean, // true if successful, otherwise false
   callId: uniqueId // same uniqueId passed in the __cmpUICall message
}

Once the CMP receives the __cmpUIReturn message, it will destroy the iframe.

 

 

Standalone UI integration

When the CMP requires the user to provide consent, it will redirect to config.uiUrl with a redirect_url query parameter. Once the user has saved their consent, the UI should redirect back to the redirect_url passing an EuConsent query parameter with the value of the base64 consent string.

Have more questions? Submit a request