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.

OnCue’s sampling capabilities are very powerful and none are more powerful than the JavaScript sample trait.  It provides the ability to monitor for events to take place in your sites web pages that will dictate whether a site intercept will run for a particular user.  This kind of site intercept can be particularly helpful for getting customer experience feedback on a section of a site or a site process.  Because this is one of those few places in OnCue where you need to write some code it is recommended that you have a modicum of JavaScript skill and with the following examples some simple JQuery understanding.

Triggering Site Intercept based upon an On Click Event

The code below is a single line of code that will look for a particular element in a web page to be clicked and will make the JavaScript sample trait true.

OnCue.$("#lga img").one("click", __ON_TRAIT_MATCH__);

The $(“”) is a jQuery function that lets you look for certain elements within the web page.  It is the most used of all jQuery functions and can be quite powerful.  I won’t go into a full blow explanation of jQuery selectors but here is a link to the api reference and another to a simple jQuery Primer.   The above example is finding the image tag that has and ID of #lga and hooking its “click” event.   In this case we are using the Google Logo on the google home page as the example.

You can also define different events other than “click” to trigger a site intercept for your customer experience research.  We have only tested the code using “click” but feel free to try to monitor for other events such as mouseover or onkeypress.  Just make sure the element you are monitoring uses that event. Here is a list of HTML events.

Here are a few other examples:

Example 2:

OnCue.$("a[title='HIGH PERFORMANCE']").one("click", __ON_TRAIT_MATCH__);

Identifies an anchor tag that has the title HIGH PERFORMANCE. This example was actually a menu item

Example 3:

OnCue.$("a[data-sublist-translation='select_brand']").one("click", __ON_TRAIT_MATCH__);

Identifies an anchor tag with an attribute that had select_brand as the value. This element triggered a drop down and did not navigate between pages.

Important things to remember when using JavaScript Traits

site intercept in new browser window

  1. If the click event causes a navigation you have to open your research using a “New Browser Window” under the Behavior tab.
  2. If the click does not cause a navigation you can use an “On Page Dialog” or you can use an Opt-in Dialog but if you choose to use an Opt-in Dialog you need to make it part of the same Sample Group.  Rule of thumb is that all traits in a Sample Group must be true for research to be triggered.  Two or more Sample Groups are treated as either situations.  If one Sample Group is true the research can be triggered.

The Code if you don’t want to copy it from above.

Please direct any questions to OnCue support.

Despite how many survey invitations you think you are getting while you browse the Internet, there are really very few sites conducting more than a single website research project at any one time. It’s a shame that a company goes to great lengths and considerable expense to bring visitors to their site and then wastes the opportunity to gather feedback from these site visitors to help decide important decisions being made. These decisions are not just about the site design and user experience but can be used to fuel all kinds of business decisions.

I have a technical term for this condition. It’s called Synchronous Website Research Syndrome or SWRS for short. What it really means is no more than one research project in the saddle at a time. SWRS has two primary causes. First most websites today are implementing website research the same way they were in 1999. This usually means you deploy your research whenever your IT department decides to get around to it. Second there is the eminent domain issue that can arise when one group controls access to all research on a website and won’t share because of reason number one. The results of SWRS are that your business either doesn’t ask the business questions needed to make good decisions or the researcher utilizes online panels which can be costly and don’t always represent a company’s customers like their site visitors might.

For years there was no cure for SWRS, but due to numerous breakthroughs and years of R&D there is now a cure. I call this cure Asynchronous Website Research or AWR. multidinosaddleAWR facilitates multiple research projects being conducted simultaneously on a single website. Additionally, it changes who controls when and how research is deployed. Tag management solutions are starting to change the old 1999 way of deploying website research, but even these don’t take into account the idiosyncrasies around sampling site visitors.

Tools like Adobe Survey®, Qualtrics Site Intercept® and now our own product OnCue™ are a new class of research technology that we refer to as website research management tools. These tools use tag management principles to deploy more than one research project. Also, they use behavioral targeting techniques to help better qualify the visitor before presenting them with the research. The primary differentiation to other tag management tools are that these website research management tools handle rules of:

• When and on what pages to present the research

• Native opt-in dialogs

• Setting cookies to restrict further participation

• Native display of the research which can be things like showing the survey in a light box over the current page.

The primary benefits to an AWR ready site are the ability to conduct on-demand research at any time, share a sites visitors over multiple research projects so you can get more answers for more groups and finally cut some of your usage of panels and the hard dollar costs associated with that kind of research.

How would you use Asynchronous Website Research to in your website research strategy?

Here at Usability Sciences, we find ourselves in need of new forms relatively often. Whether we’re trying to capture feedback on a specific page or attempting to provide support for a product, we can always find a need for a new form. What seems to be the most frustrating aspect of form creation is the the time it takes and levels of personnel we traditionally have had to go through to successfully implement new forms.
This frustration is one of the reasons we designed and built OnCue.  No longer do we wait days or weeks to capture necessary data, but instead we can begin to capture data within minutes of creating our form in a tool like Wufoo. It’s not just forms we are able to implement, but also surveys, user experience, taxonomy, and analytics tools.
OnCue has the ability to provide all of these things simpler, faster, and without the use of the IT department.  OnCue allows for seamless integration of new forms on the go (that means it’s mobile ready). Watch the video below to learn more about OnCue in this informative demo of OnCue and Wufoo together.

Interested to learn more about OnCue?  Visit www.oncueresearch.com for full details.  You can even sign up to participate in our Beta. Wouldn’t it be nice to implement forms, surveys, and analytics tracking on the fly?

Take charge of your customer experience research!

Use the best tools and never wait on IT again