• Resolved asafm7

    (@asafm7)


    I’m looking for a cookie that can indicate if any Complianz-related action has been taken by the visitor – for bypassing any cache in this case.

    I’m currently using cmplz_banner-status but looking at the source code, I’m not sure it is being set on all relevant scenarios.

    • This topic was modified 1 year, 8 months ago by asafm7.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @asafm7,

    What action specifically, you could use a function like cmplz_get_banner_status()
    to see if the banner is dismissed, so consent is most likely configured.

    It won’t show all possible changes, like revoke, change of preferences, etc. These have their own functions, what is the use-case?

    regards Aert

    Thread Starter asafm7

    (@asafm7)

    Thanks @aahulsebos .

    The use case is dynamic caching. I want to cache the entire HTML of the page (this can really bost performance. BTW, the ability to do it with your plugin is the reason I switched from CookieYes).

    As cookies are cached together with the HTML, the HTML should only be cached in a “clean” state – without any changes made by consent (or revoke) actions. Tools like Cloudflare and LiteSpeed Cache allow to bypass cache according to cookies.

    So I’m looking for a cookie that if existing indicates that some consent action been made – and hence the page shouldn’t be cached. And if not existing, it is a sure indication that the HTML can be cached.

    I hope it is clear. Let me know if not.

    Thanks again!

    • This reply was modified 1 year, 8 months ago by asafm7.
    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    You could take a look at our events, in this case maybe the cmplz_enable_category is useful.

    document.addEventListener("cmplz_enable_category", function(consentData) {
    	//do something 
    });

    Where consentData contains:

    consentData.details.category:current enabled category;
    consentData.details.service: if not a category was enabled, the current enabled category;
    consentData.details.categories: the current accepted categories
    consentData.details.services: the current accepted services
    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    If your use case is purely server side, You probably need to check the cmplz_functional, cmplz_statistics, cmplz_marketing cookies. If any of these change, consent has been changed.

    the banner status cookie only tells us if the banner is open or closed, and does not say anything about consent.

    Thread Starter asafm7

    (@asafm7)

    Thanks you @rogierlankhorst .

    The thing is that any Complianz-related action, not just consent or rejection, shouldn’t be cached.

    When the banner is dismissed, a cookie is set. If this cookie is cached, the next visitor won’t see the banner, even if it’s their first visit.

    So, we can set a cookie that indicates if any Complianz-related action has been taken. For example, “cmplz_action=true” or “cmplz_no_cache=true”. The absence of this cookie will indicate that the page can be cached. On the other hand, the existence of this cookie will indicate that the page must not be cached.

    Maybe the cmplz_add_event() function, through which all events are added if I understand correctly, can be programmed to always set such an indicative cookie.

    Does it make sense?

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Hi @asafm7,

    You can use the custom events of Complianz to hook into, and add your own cookie there. Additionally, you can use all current placed cookies.

    but please note that there are actually two different states of html: the one with, and one without consent. The state with consent can be split into the specific categories. So each category cookie represents a state. Outside of that, there isn’t anything else that needs be moved outside caching. The categories cookies should cover all possible html variations as far as Complianz is concerned.

    Thread Starter asafm7

    (@asafm7)

    Thanks @rogierlankhorst . Yes, I assume the state of a banner dismissed with the X button is the only non-consent html state. Anyway, I will try to utilize existing events or cookies.

    Thank you very much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cookie to track if any Complianz-related action has been taken’ is closed to new replies.