Custom consent form

Needed permissions: owner

If you want to show visitors a custom consent form instead of a ready-made form from Consent Manager, you can use our custom solution and API.

An example of a custom consent form in Piwik PRO.

Before you start

Here are some things to know before you set up a custom consent form:

  • You need to install an asynchronous tracking code on your website.
  • A custom consent form overrides default forms.
  • All collected consents will show up in Consent Manager.
  • Approvals made via a custom consent form affect data collection and tag firing mechanism.
  • To design the custom consent form, you can use our example implementation available on GitHub

Enable a custom consent form

To enable a custom consent form, follow these steps:

  1. Go to Menu > Administration.
  2. Navigate to Websites & apps.
  3. On the left, pick a website or app that you want to work with.
  4. In Privacy, click Configure.
  5. Configure privacy settings in Piwik PRO.
  6. Check Custom consent form. This form will override a default consent form.
  7. Check custom consent form in Piwik PRO.
  8. Click OK.

Design a form

To design the custom consent form, you can use our example files from a GitHub repository.

Add a script and CSS style

To show a custom form on your website, follow these steps:

  1. Add the following script before </body> HTML element on your site.
  2. <script>
        var ppms_consenturl="https://cdn.piwik.pro/consent/1.1.1/form.html";
    </script>
    <script src="https://cdn.piwik.pro/consent/1.1.1/script.min.js" integrity="sha384-lygGKHTWa1t5vmtzcuqMu+8lSJMvrjmjSjUPtGHdNw9ECkG5lhO+yT84ZDZwomqu" crossorigin="anonymous"></script>
  3.  Include CSS style after <head> HTML element on your site.
<link rel="stylesheet" href='https://cdn.piwik.pro/consent/1.1.1/style.min.css' integrity="sha384-DqTbs8R8D2euyCDTPA0lOFt/dC1wZw0P23QBg8kpHkmRDdUZZik4AuSdvmOmGqLX" crossorigin="anonymous" />

Note: Check the latest version on GitHub to be up to date.

Was this article helpful?

Technical Support

If you have any questions, drop us a line at support_SPC@piwik_SPC.pro.

We’re happy to help!