Forum Discussion

Claudius's avatar
4 years ago

Checking for user cookie consent

Wanted to share this Freemarker snippet for use in custom components which checks if a user gave consent to the Khoros Community popup for cookies.

<#assign cookieConsent = http.request.cookies.name.get("LithiumCookiesAccepted") />
<#if cookieConsent?? && cookieConsent.value?? && (cookieConsent.value == "true")>
    <#-- Lithium/Khoros Cookies are accepted -->
</#if>

We are using this in our community to show a close button on announcement banners and only then set a cookie to hide the announcement banners until their content changes.

  • Great info! Our company uses their own datalayer for a single cookie consent across all subdomains. On our communities we also use this for displaying our feedback pop-up.