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

Consent Solutions Knowledge Base

UCP - Test For Consent Required Using consentIsGiven Command

To test a site notice, where Consent is Required, there is a flag in the site notice settings that you can use to verify this is working properly.  To see whether an active user has provided consent, run the command `evidon.notice.consentIsGiven` in the devTools Console.

1) Navigate to a site with a notice that has Consent Required.  Require or disable consent required using the checkbox in Step 3 of the Privacy tool. 
Note:  On a notice where consent is not required or a country is not specified on the notice, the following tests will return `true` as the expected result.

 

 

 

rtaImage-1.png

2) Open devTools (f12) and click on Console.

3) Execute the command `evidon.notice.consentIsGiven` in console, verify it returns FALSE

 

rtaImage.png

3) Give consent 

4) Execute the command again, verify it returns TRUErtaImage-2.png

 

5) Refresh the page

6) Execute the command, verify it returns TRUE (this is where it was breaking, it was intermittently returning FALSE) 

 

 

rtaImage-3.png

 

If you test a site/country that doesn't have consent required, the command returns TRUE before giving consent, that's also expected since consent is not required.

If you want to take it a step further.

7) Clear our consent cookie 

 

 

rtaImage-4.png😎 Refresh the page, rerun the command and it then should return FALSE as you have effectively withdrawn consentrtaImage-5.png

Labels (1)
Version history
Revision #:
4 of 4
Last update:
‎05-15-2019 09:24 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.