Custom consent form

Consent Manager

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

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 > Consent Manager, click Configure.
    Custom consent form in Piwik PRO
  5. Check Custom consent form. This form will override a default consent form.
    Custom consent form in Piwik PRO
  6. 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.
    <script>
        var ppms_consenturl="https://example.com/path/to/form.html";
    </script>
    <script src="https://example.com/path/to/script.min.js"></script>

    Note: Change https://example.com/path/to/ to the path on your site.

  2.  Include CSS style after <head> HTML element on your site.
    <link rel="stylesheet" href="https://example.com/path/to/style.min.css" />

    Note: Change https://example.com/path/to/ to the path on your site.

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

Was this article helpful?

Technical support

If you still have some questions, visit our community.
There’s always someone ready to help!

Back to help center