Are you interested in preventing Qualaroo from displaying a Nudge for a specific period of time? You can accomplish this by first adding code to your snippet that sets a cookie for a length of time determined by you. Next, you can adjust your survey's targeting options to prevent it from firing if the cookie is present.
1. Append the following JavaScript to your Qualaroo snippet
<script>
;(function(){
window._kiq = window._kiq || [];
// Helper function to set cookie
function _setCookie(e,t,i){var o="";if(i){var n=new Date;n.setTime(n.getTime()+24*i*60*60*1e3),o="; expires="+n.toUTCString()}document.cookie=e+"="+(t||"")+o+"; path=/"};
// Tells Qualaroo to set a cookie called "__qual_seen" that expires in 30 days when the user sees any survey
window._kiq.push(['eventHandler', 'show', function(){
_setCookie('__qual_seen', '1', 30);
}]);
})();
</script>
This example sets the cookie for 30 days, but you can change it to anything you like. For example, if you want to only store the cookie for 10 days you can change the number of days in the last value passed to _setCookie like:
_setCookie('__qual_seen', '1', 10);
2. Adjust the Targeting settings for your surveys to not show if the __qual_seen cookie is present
Go to the Targeting tab for each survey you want to not show if the cookie is present. Under Target: Advanced, enable the option “When specified cookies are present on the user’s browser”. Choose “Do not display” when “Any” cookies are present. Enter __qual_seen in the provided field. Save settings.
Comments
0 comments
Article is closed for comments.