Step 3 - How to Brand Your Own Consent User Interface

Publishers can easily integrate their CMP consent UI with Oath’s CMP.

The consent UI is responsible for capturing user consent. Once captured, the consent is passed to the CMP. The consent UI can be rendered as an iframe, rendered in a modal directly on the site, or as a standalone page that the CMP would redirect to.

Oath has implemented a reference implementation of the CMP consent UI. It is available on Github at Please see the README in the Git repository for more details.

The uiUrl and uiDisplayMode configuration properties passed to the “init” command tell the CMP JS where the publisher’s UI is hosted and how the CMP UI should be rendered. Here is a sample “init” command that uses the “iframe” display mode.

window.__cmp('init', {
   uiUrl: '',
   uiDisplayMode: 'iframe',

The cmpuiforoath reference implementation supports both the display modes (iframe and standalone).  CMP JS requires a certain interface to be implemented by the consent UI for each of the 2 display modes.  The reference implementation supports both of these display modes. For more detail on the interfaces for each mode, please see Alternative options for including CMP JS


Related Articles

Have more questions? Submit a request