Crownpeak (Retired)

UCP - Implement Consent Tool Link

Universal Consent Platform
Implementing Options Dialog Link


This document outlines the process of adding a link to our Options Dialog either to a
customer page or in other elements such as the banner translation text.
This has been a common request from our customers so it seems like a
good idea to put together a little document they can use as a reference to implement
the Options Dialog.

 Anchor Link with Javascript (recommended mechanism)

Our scripts have a fully supported Application Programming Interface (API)
included with them.
Part of that API is the ability to instruct our scripts to show the Options Dialog.
Since that is available, and included on every page where our script executes,
you can add an html anchor link (<a>) around any text where you want to include
a mechanism to open the options dialog.
The following is an example of how that link could look:

<a href = "#"onclick ="event.preventDefault
()window.evidon.notice.showOptions();">Open Options Dialog</a>

In this link the core functionality is located in the onClick handler of the anchor tag
Inside that event we do 2 things.

First, we instruct the script to prevent the default behavior, which is to navigate to the
location in the href attribute.
We don't want that to happen as it may cause the page to reload.

Second, we call the API method showOptions(), which is located on our notice object.
This will trigger the consent tool to display.

The following is a list of the available mechanism along with some
pros/cons of each.


  • Will show the consent tool using the same logic as our other script components, providing a more unified experience.
  • Uses our API which means any future changes in functionality will automatically be supported.
  • Because it uses the notice settings it will handle any change to how the consent tool is displayed. For example, if you decide you want to open a new window instead of showing a popup you can change your 
    notice settings and this will automatically pick up those settings and use them. No changes will be required beyond that.



  • Requires the use of javascript. This may or not be a con depending on customer rules.

Javascript API

We have provided an example of using a link with javascript to activate our API. But you can also just call the API from any script on your page. The call would be the same:
window. evidon. notice.showOptions();


  • Can be used for any element, not just a link. so a customer can have their own button for example.
  • Flexible. Can be used from different scenarios. For example, if a customer has a need to perform some other action before showing the consent tool they can use their own scripts to accomplish that.

  • Like the anchor link example, this will automatically pick up all the settings for the consent tool and use them.


  • Requires the customer to deploy separate scripts on their site.
  • Doesn't have an easy integration with any translation elements. If they want to trigger the consent tool to open from our banner they need to take some extra steps. 
Labels (1)