Matomo/Piwik Opt-out – no iframe, no cookies!

With a little help from I created a script that lets users opt-out of Matomo (formerly Piwik) data collection without the need for cookies or the default iframe provided by Matomo.



The major point was avoiding the ugly iframe. But I thought the fact it doesn’t need cookies to be very helpful since I am running my Matomo installation with the disableCookies option set. The script uses the HTML5 Web Storage ability. Data stored that way will never be sent to the server and will only ever be available locally.

Additionally my Privacy Policy page contained both an English and a German version as this is the only page I needed in both languages. The script is able to handle multiple language versions of the Opt-Out in one page.

Find the script on
Read the README carefully for the other code you’ll need besides the actual script.