_paq.push(['requireConsent']); not working

_paq.push([‘requireConsent’]); to require consent from the user to set cookies seems to be failing.
_pk_id and _pk_ses cookies are being set without calling setConsentGiven

I was developing locally, but also set up a simple test site online, where it’s failing too.

The closest related bug I found is this one, though it’s not really helpful.

It’s happening in Chromium, Chrome and Firefox, with matomo version 3.13.5

The code is basically as follows (I could share the site via PM too):

    <meta charset="UTF-8">
    <title>Test page</title>
    <script type="text/javascript">
        var _paq = window._paq || [];
        /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
        (function() {
        var u="https://-redacted-/";
        _paq.push(['setTrackerUrl', u+'matomo.php']);
        _paq.push(['setSiteId', '1']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);

Any ideas? Thanks!


That sounds a bit like

Thanks! Almost two years without a followup or more comments. I can’t believe this hasn’t got more attention with all the GDPR fuss.