EdLiguori
Crownpeak (Retired)

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)

Can't find what you are looking for?

Find Answers

Search our DG Forum to find answers to questions asked by other DG users.

Ask a Question

No luck? Ask a question. Our Product and Support teams are monitoring the Forum and typically respond within 48 hours.

Ask a Question