Site Intercept triggered on Screen Exit

Try OnCue Free

No credit card needed

This JavaScript sample trait code was written to estimate when a user has moused over a particular part of the screen in order to trigger a site intercept.   The idea is to estimate when a user is going to close the browser or possibly hit the back button on the browser.

Important information about site intercepts using screen exit 

  1. If the user moves the mouse so quickly over the area that the browser does not register the action, there is nothing we can do.
  2. This can generate false positives.  This is not a guarantee that the user was planning on leaving the page or closing the browser so keep that in mind with your subsequent research.
  3. You can only trigger a site intercept research that uses Opt-in Dialogs, On Page Dialogs or Redirection.

Examples Discussed

The only thing needed to setup the code is to define the regions you wish to monitor.  The example below monitors for the user mouse to enter right and left corners of the browser.  Thus you can cover the exit and back buttons on most browsers.  You can define the areas to watch in % or in px.  You can setup multiple regions like in the code or just use a single region.  For instance you could trigger a site intercept by setting up the ‘upper 30% middle 100%’  to capture any mouse movement into the upper 30% of the visible screen.

More Examples:

  • upper 100px right 50%
  • upper 10% middle 100px
  • lower 150px left 150px
  • middle 50% right 50px

Configurable Section of the Code

var REGIONS = [ "upper 30% middle 10%", "lower 50px left 50px" ];

To use the code please use one of the linked files to get the entire set of code.  Compressed Version of the Code  (use this version) and Uncompressed Version of the Code.

If you would like to know more about triggering a site intercept when a user clicks on a page element please see the previous blog post JavaScript Traits Triggering research based upon a Click Event.

Please direct any questions to OnCue support.

Take charge of your customer experience research!

Use the best tools and never wait on IT again