Matomo/Piwik Opt-out – no iframe, no cookies!
- no iframe
- no cookies
- fallback message for old browsers that don’t support HTML5 Web Storage
- check for browser’s Do Not Track setting
- support for multiple languages in one page
- jQuery 2.0+
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.
Find the script on GitHub.com/clivebeckett/matomo-opt-out
Read the README carefully for the other code you’ll need besides the actual script.