API.requestConsent()

Allows a user to give consent to unblock the blocked content

If there is an API.button in your placeholder, its click handler is automatically bound to this
method. If you which to handle your own consent interaction flow, you may call this function directly:

📘

Note that if your placeholder has the mtm:one-click meta tag, those semantics still apply.

<!DOCTYPE html>
<html>

<head>
    <meta name="author" content="My Company"/>
    <meta name="title" content="My Placeholder"/>
    <script src="confirmic-api.js"></script>
</head>

<body>
    <button>
      Agree to run content
    </button>
    <script>
      document.querySelector('button').addEventListener('click', function onClick() {
        API.requestConsent();
      });
    </script>
</body>

</html>

Did this page help you?