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

Hi,
_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):

<head>
    <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" */
        _paq.push(['requireConsent']);
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (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);
        })();
    </script>
</head>

Any ideas? Thanks!

Hi,

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.