How to not display Proactive Message to repeating Visitors

If you want to avoid spamming repeating visitors to your site with the same proactive message, all you need to do is swapping the below default code in the Share / Embed section...

<script>
// Show a proactive message on landbot load
myLandbot.on('landbot-load', () => {
myLandbot.sendProactive("Hello there!");
});
</script>

...with this new one:

<script> window.onload = function () { 
var proactiveShown = localStorage.getItem('proactiveShown')
if (proactiveShown != 'true'){
localStorage.setItem('proactiveShown', 'true')
myLandbot.on('landbot-load', () => { myLandbot.sendProactive("Hello there!"); }); } }
// ualee_063 //
</script>

You will need to change the "Hello there!" message for the one you need.

Now the Proactive Message will be displayed just the first time the visitor checks your site. And as long as the visitor doesn't clear the browser storage.

These scripts and how to's are not native functionalities. Landbot won't be able to support, help or guarantee these scripts and how to's. These Workarounds and How to's are for developers, as a learning and example material on how to extend or modify some of the platform limitations.  Due to platform updates, some scripts might stop working in the future.Please, note that in case of Scripts and Workaround the Custom Success Team can deliver limited support.


How did we do?


Powered by HelpDocs

Powered by HelpDocs