Costomizing a Consent popup

Hi! I am new to Piwik, and I fighting a lot to create a custom popup very similar to the demo modal popup:

Enable " Ask visitors for consent" and set Custom form doesn’t appear.
If I disable it, appears the custom popup that I created with the tag custom popup.

But If I add the code from the demo, the popup don’t appears and I get this message in the console:

VM216:4 Uncaught TypeError: Cannot set properties of null (setting ‘onclick’)
at :4:33
at :8:11
at renderNode (c96ca04d-d1fc-410b-abc2-ebcf90e2aa9d.js:8:132609)
at Array.forEach ()
at e.render (c96ca04d-d1fc-410b-abc2-ebcf90e2aa9d.js:8:132428)
at c96ca04d-d1fc-410b-abc2-ebcf90e2aa9d.js:8:151525
at Array.forEach ()
at e.consume (c96ca04d-d1fc-410b-abc2-ebcf90e2aa9d.js:8:151490)
at e.handleEvent (c96ca04d-d1fc-410b-abc2-ebcf90e2aa9d.js:8:149190)
at e.consume (c96ca04d-d1fc-410b-abc2-ebcf90e2aa9d.js:8:148766).

I am stuck with Piwik. Do you have any suggestions?

Hey @Mariana,

When it comes to "Ask visitors for consent" and set Custom form doesn't appear. You can find these settings by navigating to Menu > Administration > (Your Site / App) > Privacy

Once you view the consent settings, you should be able to find the “Use a custom consent form” option at the bottom -

When it comes to the error, how did you add the code from the template? Is it in a Custom code tag?

The template code should be added in a custom code tag with No consent is required as the consent type and All page views as the trigger.

Here you can find the guide on how to implement it although I presume you already saw that - Piwik PRO - Custom consent form example | Custom consent form example for Piwik PRO Consent Manager

Super!!! Now I got the custom modal popup.
The error was that I added the custom Code using the popup tag. On apply the code with the Custom code tag, it works nicelly.

1 Like