I am trying to get GDPR type consent to work on an EE5.1 site.

The methods are pretty much the same as the examples in the EE5 documentation.

Consent cookie is being set OK (I can see it appear in Chrome Inspector when a consent_grant_url button is pressed), but try as I might, I cannot get {consent:ee:cookies_performance} to pick up that a cookies has been set.

The setting code is

    <button type="submit" name="submit" class="btn btn-success" href="{consent_grant_url}">Accept</button>          
    <button type="submit" name="submit" class="btn btn-outline-info" href="{consent_withdraw_url}">Decline</button>

the reading code is

{if consent:ee:cookies_performance}
    Google Tracking Code snippet

but this refuses to fire.

Quoting out the {consent:ee:cookies_performance} tag reveals it to be empty (which explains why conditional won't fire) - but I cannot work out why. I'm sure I'm missing something obvious... any ideas / suggestions would be hugely helpful.. Thanks! (EE5.1.0)

1 Answer 1


Solution turns out to be in the setting: some confusion in documentation about how to construct the setting code. But what worked was swapping to use the exp:consent:requests tag, and turning the form buttons into regular anchors. Why it worked ( and / or worked sort-of before) is a mystery - but posting here in case useful to others:

{if ! consent:has_responded:ee:cookies_performance}
<div class="container-fluid cookie-consent" id="cookieConsent">
    <div class="row">
        <div class="col-sm-10">
        <div class="col-sm-2 align-self-center text-center">
            <a class="btn btn-block btn-success" href="{consent_grant_url}">Accept</a>          
            <a class="btn btn-block btn-outline-info" href="{consent_withdraw_url}">Decline</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.