Measuring consent rates with Matomo

To be able to measure the consent rate using Matomo, only 1 line of JavaScript code per button is required.

Why use Matomo? Matomo can be loaded without consent. It is therefore suitable for this type of analysis, as all visitors can usually be measured.
Other analysis tools such as Piwik or Plausible would also be suitable for this. It is important that they are those that can be loaded without consent.

The following 3 snippets must be added within a script tag in the HTML of the page so that the popup events can be waited for.

Accept selection” button

window.addEventListener('lw-popupaction-accept-selected-complete', function (e) { if (_paq != null) _paq.push(['trackEvent', 'CMP', 'CMP Button Clicked', 'Accept Selected']); });

Accept all” button

window.addEventListener('lw-popupaction-accept-all-complete', function (e) { if (_paq != null) _paq.push(['trackEvent', 'CMP', 'CMP Button Clicked', 'Accept All']); });

Button “Accept nothing”

window.addEventListener('lw-popupaction-dismiss-all-complete', function (e) { if (_paq != null)_paq.push(['trackEvent', 'CMP', 'CMP Button Clicked', 'Dismiss All']); });

Result

Similar posts

JavaScript methods

JavaScript methods Various methods are provided for interaction with other functionalities of the website.This offers the possibility to control the ... Weiterlesen ...

JavaScript Events

JavaScript Events Various events are provided for interaction with other functionalities of the website.This offers the possibility to control the ... Weiterlesen ...

Google Consent Mode

Google Consent Mode & Advanced Consent Mode This article is an introduction to the Theme Consent Mode, as well as ... Weiterlesen ...

Piwik Pro: convert anonymous tracking to advanced tracking

Load as technically necessary and collect more visitor data after consent In our article https://legalweb.io/news/matomo-piwik-pro-rechtskonform-einbinden/ on Piwik Pro, both variants ... Weiterlesen ...
Privacy
The controller (legal web GmbH, Austria) would like to use the following services in order to process your personal data. Technologies such as cookies, localStorage, etc. can be used for personalization. This is not necessary for the use of the website, but allows us to interact with you more closely. If you wish, you can adjust or revoke your consent at any time via our privacy policy.