• Resolved ralfkerkhoff

    (@ralfkerkhoff)


    Hi,
    has anybody implemented Koko analytics with real cookie banner?

    I am struggling to_:
    1. Avoid that the analytics cookie will be set.
    2. the tracking is recorded.

    It would be cool if someone can share his solution.

    Thanks for your help
    Ralf

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ralfkerkhoff

    (@ralfkerkhoff)

    I finally got it working.
    For those who are interested here is how it works:

    Create a service and add this code to “execute at optin:
    <script>
    if (window.koko_analytics) window.koko_analytics.use_cookie = true;
    </script>

    In the corresponding content blocker add this to blocked elements section:
    */koko-analytics/assets/dist/js/script.js*

    Keep in mind that Koko does not record visits if the “don not track” option is set in the browser options.
    It will not collect data even if the visitor consents in real cookie banner. To avoid this add the following to the functions.php of your theme:

    add_filter('koko_analytics_honor_dnt', '__return_false');
    
    add_action('wp_enqueue_scripts', function() {
        wp_add_inline_script('koko-analytics', 'window.koko_analytics.use_cookie = navigator.doNotTrack !== "1"', 'before');
    });

    Cheers
    Ralf

    Plugin Author devowl.io GmbH

    (@devowl)

    Hi Ralf,

    Thank you for your inquiry. Your solution is a bit hacky, as I understand you are misusing the Do Not Track functions a bit.

    We have a service template with a clean integration, which it needs due to the architecture of Koko Analytics, already on our to-do list.

    However, please note that we currently receive a lot of requests for new service templates, so we have to prioritize its implementation. The template you requested has not been requested very often yet, so I have to ask you for some patience. Currently, we expect a waiting time of more than two month.

    We will come back to you by as soon as the service template is available in Real Cookie Banner!

    Best regards,

    Jan

    Thread Starter ralfkerkhoff

    (@ralfkerkhoff)

    Hi Jan,
    i am looking forward for the new service template ??

    I think the “problem” is that Koko does not record any hits when DNT is set. That is different from Statify (visits are counted with DNT set).

    Without the addition to the themes function file no visits are counted when DNT is set – in this case there is no need to consent.

    So, yes my solution is not 100% clean.

    Ralf

    Thread Starter ralfkerkhoff

    (@ralfkerkhoff)

    Hi Jan,
    one additional question:
    After the visitor consents, a cookie is set with:
    <script>
    if (window.koko_analytics) window.koko_analytics.use_cookie = true;
    </script>

    Is there a way to delete the cookie if the user removes his consent via the privacy settings?
    At the moment no visits are counted when the user removes his consent – but the cookie is still there.

    Cheers
    Ralf

    Plugin Author devowl.io GmbH

    (@devowl)

    Hi Ralf,

    if you go in your WordPress to Cookies > Services > Koko Analytis (created by yourself) > Edit, you have to add all cookies to the “Technical cookie information” section. In addition, you have to activate the option “Delete all first-party cookies after opt-out. First-party cookies are only cookies that are set by or for this domain.” in the section “Technical handling”.

    Afterwards, once the user opt-out, all first party cookies of the service will be deleted.

    Best regards,

    Jan

    Thread Starter ralfkerkhoff

    (@ralfkerkhoff)

    Hi Jan,

    “delete all first party cookies after opt-out” did the trick.

    Sorry for my late “thank you” – the flue has got me in the last days.

    Ralf

    Plugin Author devowl.io GmbH

    (@devowl)

    Hi @ralfkerkhoff,

    great to hear this solved the issue for you.

    I hope you get well soon ??

    Best regards,

    Jan

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Koko Analytics’ is closed to new replies.