Add delay to exit intent pop-up?


Some of my test users have commented that my exit intent pop-up was triggered very quickly, even when they weren’t trying to leave the page. Since the point of my pop-up is to ask the visitor why they’re leaving, I need to find a way to ensure it doesn’t trigger so quickly.

Is there a way to add a delay to the exit intent pop-up? In other words, the pop-up would be triggered when the cursor moves towards exit AND a certain amount of time has passed. If they move their cursor to exit before that amount of time has passed, nothing gets triggered.

Thanks in advance!

-Andrew


2 replies

Userlevel 3
Badge +1

Hi @ayedlin

I think this will solve your problem…

This script just delays adding the embed script to the host page until the “delay” value has been reached. *NOTE: Any existing version of the Convertable’s script should be removed from the host page or this script won’t work.

Required Values:

1. delayInSeconds - The amount of seconds to delay the Convertable being eligible to show.

2. convertableScriptSrc - The src of the Convertables embed script, e.g.

<script src="//f26e7782694e41398352088f013af031.js.ubembed.com" async></script>

For this Convertable script: convertableScriptSrc = “//f26e7782694e41398352088f013af031.js.ubembed.com

Host Page Script:

Define the required values and add the script to the Convertable.

<script>

 // Define the required variables
 var delayInSeconds = 5;
 var convertableScriptSrc = "//f26e7782694e41398352088f013af031.js.ubembed.com"
 
 window.setTimeout( function () {
   var script = document.createElement('script');
   script.src = convertableScriptSrc;
   script.async = true; 
   document.getElementsByTagName('head')[0].appendChild(script);
 }, delayInSeconds* 1000);
</script>

Looks like it’s working beautifully. Thank you so much!

Reply