How to enable consent checkboxes

For Workers & Pages, what is the name of the domain?

N/A

What is the error number?

N/A

What is the error message?

N/A

What is the issue or error you’re encountering

I’m trying to trigger this code to run on page load

What steps have you taken to resolve the issue?

I’ve create a Zaraz consent form that works ok.

I’ve added a Custom HTML tool with a PageView trigger that contains the following code.
It’s intended to enable the checkbox for the the iEzO consent purpose.
However, the checkbox remains unchecked and the console.log output does not appear.

What are the steps to reproduce the issue?

  1. Create a Zaraz consent form
  2. Add a purpose and link it to a Tool. I’m using Google Analytics. Note the purpose ID.
  3. Confirm that the consent form appears using a Private Window (might need to clear Application state to reset cookies)
  4. Add a Custom HTML tool to Zaraz with the code above, replacing iEzO with the purpose ID code from step 2.
  5. Reload the page
    • console.log does not execute and purpose checkbox remains unchecked in the consent form.