I don't want users to be polled immediately when they first visit my site. Is there a way to delay polling for first time visitors?
You have full control over how you embed the survey in your site. You could for example achieve this by setting a timestamp in localstorage like this:
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> <script> (function() { var firstVisitDate = window.localStorage.getItem("firstVisit"); if(firstVisitDate === null) { window.localStorage.setItem("firstVisit", Date.now()); } else { if(Date.now() > (parseInt(firstVisitDate) + (24*60*60*1000))) { window.CODEBARREL_NPS = { getUserId: function () { return undefined; } }; $.when( $.getScript("https://nps-for-jira.codebarrel.io/676c3c95851177199ebf9f5f3f1747/js/i18n.pack.js"), $.getScript("https://nps-for-jira.codebarrel.io/676c3c95851177199ebf9f5f3f1747/js/npssurvey.pack.js"), $.Deferred(function(deferred){$(deferred.resolve);})) .done(function() { $.getScript("https://nps-for-jira.codebarrel.io/rest/remote/survey-init.js?surveyId=d8c0d83f-8da3-4574-8007-cabd0c8b6c17&clientKey=jira:2c5273f3-2840-4087-bc1f-485df7dd34"); }); } } })(); </script>
This code inserts a timestamp in local storage on first visit to your site, and then compares this timestamp on subsequent visits to check if it is older than 24 hours. The NPS survey javascript will only be requested if this condition is met.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.