Suppose you have several pages planned across the customer's journey or different URLs across subdomains. In that case, Qualaroo provides the option to display a survey across your web properties after a total of seconds.
For example, if you’re doing UX research around a specific task, being able to ask users a question after they’ve been on several different pages, not just one, for any amount of time is a powerful tool.
The following code will set a timer for 30 seconds. This timer can be started on any page or subdomain and will keep counting down properly even if the user navigates to other pages or subdomains.
In order for the above to work, you need to add a custom property to your survey’s targeting that should be:
The above code starts by checking for the name of a cookie called qualOnSiteTimer and creating one if it’s not found. You can change the name anything you want.
The value of the cookie is a timestamp 30 seconds from now. You can also change this to anything you want.
On each page load that includes this code, the difference of the time to expiry for the cookie will be calculated based on the current time and create a new on-page timer for that length of time. If the user is still on this page when the timer elapses, a custom property, called “time_to_show,” is set and your survey will fire. If they move to another page, the calculation for a new time out will run again and again until the time runs out.
That is all about survey targeting based on a global timer.
Related Articles: