• Resolved toyataupitz1995

    (@toyataupitz1995)


    Hello, is it possible that the chat window always starts over and does not always start where you left off the last time. Every time I come to the site, the last session is saved and continued there. But I want a new one to start over and over again, is that possible?

    Best reagrds
    Toya

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support kamiltidio

    (@kamiltidio)

    Hi!

    Thank you for writing in.
    While we do not have a built-in option like that, as the chat history is saved in the local storage of the web browser – we do have a workaround for it.

    Please simply paste this code and change the “PK” from the ‘tidio_state_PK’ to your own Public Key which can be found in the Developer section of Tidio. https://www.tidio.com/panel/settings/developer

    After the code is injected correctly – it will clear the whole chat after reloading the page.

    window.addEventListener('beforeunload', function(){
    const stateKey = 'tidio_state_PK';
    const state = JSON.parse(localStorage.getItem(stateKey));
    console.log(state.messages)
    const newState = {...state, messages: []}
    localStorage.setItem(stateKey, JSON.stringify(newState));
    })
    Thread Starter toyataupitz1995

    (@toyataupitz1995)

    Hello,

    okay but i’m so sorry i dont understand where i have to put this code and what i do with the “PK”

    https://my.hidrive.com/lnk/DBRkLlTx

    here are the settings and where must i put the this code?

    Plugin Support kamiltidio

    (@kamiltidio)

    window.addEventListener('beforeunload', function(){
    const stateKey = 'tidio_state_u3abhqrefntf1eidhqkakxnno6vecorr';
    const state = JSON.parse(localStorage.getItem(stateKey));
    console.log(state.messages)
    const newState = {...state, messages: []}
    localStorage.setItem(stateKey, JSON.stringify(newState));
    })

    Hi! Thank you for writing back.
    In your case the code should be as above – you can put it below Tidio code in your page.

    I’ll be here in case of any further questions!

    Thread Starter toyataupitz1995

    (@toyataupitz1995)

    Hello,

    https://my.hidrive.com/lnk/ByRELHNq

    i put this code see in the pic into footer.php

    But it doesnt’s clear the chat after Reloading the page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Close session’ is closed to new replies.