<script>
const hasSeenKey = 'hasSeenChat';
const expiryKey = 'hasSeenChatExpiry';
const expiryInHours = 24; // set your desired time limit
// Check if user has opened the chat before and if data is still valid
const hasSeenBefore = localStorage.getItem(hasSeenKey);
const expiryTime = localStorage.getItem(expiryKey);
const now = Date.now(); // current timestamp in milliseconds
const expiresAt = expiryTime ? parseInt(expiryTime, 10) : 0;
// If not seen before or if the current time has passed the stored expiry
if (!hasSeenBefore || now > expiresAt) {
// Setup and show the chat
ktt10.setup({
id:"5H1KphMy28cG",
accountId:"1061315",
color:"#009A42",
icon:"https://res.cloudinary.com/drt2tlz1j/image/upload/v1733333698/ai_qyquca.svg"
});
setTimeout(function() {
ktt10Btn.click();
localStorage.setItem(hasSeenKey, 'true');
localStorage.setItem(expiryKey, (now + expiryInHours * 60 * 60 * 1000).toString());
}, 3500);
}
</script>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter