DG and Privacy UX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Consent Solutions Knowledge Base

UCP - Implement Consent Tool Link

Universal Consent Platform
Implementing Consent Tool Link


Purpose

This document outlines the process of adding a link to our consent tool 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 consent tool.

 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 Consent Tool.
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 consent tool.
The following is an example of how that link could look:

<a href = "#"onclick ="event.preventDefault
()window.evidon.notice.showConsentTool();">OpenConsentTool</a>

In this link the core functionality is located in the onclick handler of the anchor tag
(onclick="").
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 showConsentTool(), 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.

Pros

  • 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.
  • Supports showing the Consent Tool as an over
     

Cons

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

Anchor Link with Marker

We support putting in a generic marker into a link element which will be replaced with the consent tool link at runtime. The marker is the following:

{consentToolUrl} 
[note: the open/closing brackets are required)

When we load our elements (the banner for example) we will run a string replacement on that text and automatically change that marker to the correct consent tool url for the active notice and country.
An example of what this would look like:
<a href=”{consentToolUrl}”target=”_blank”>ConsentTool</a>    

Pros

  • Simple to implement
     
  • No scripting required
     
  • Future-proof. If we make changes to the consent tool format this will automatically adapt to those changes.

Cons

  • Doesn't support showing the consent tool as an overlay.
     
  • Only works in our translation elements. Can't be added to a web page outside our banner or barrier text.
     

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.showConsentToo/();

Pros

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

Cons

  • 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 (2)
Version history
Revision #:
2 of 2
Last update:
‎05-15-2019 08:55 PM
Updated by:
 
Contributors
Looking for more?
Ask in Discussions
Developers

Peer-to-peer support  and answers on developing CMS templates, modifying privacy scripts or building integrations.

Digital Experience Management

Find answers and ask questions on content management, personalization and targeting.

Digital Quality Management

Find answers and ask questions on WCAG and SEO quality management.

Digital Governance

Find answers and ask questions on consent and monitoring solutions.