A basic example of a poll form with a question and a simple Yes/No answer. The response is stored as a tagattached to the current user. You can also modify the code to useevents instead and store more data (like the current page the user is on, the question text, username, etc.).
Example
You can test in this JSFiddle (note that this fiddle does not actually send data to UXWizz).
Add this in a <script> tag or include it as an external JavaScript file somewhere after the tracker is included.
(function() {if (localStorage) {if (localStorage['ust-poll-closed']) return; }var prevOnLoaded =UST.onLoaded;UST.onLoaded=function () { prevOnLoaded &&prevOnLoaded();var poll =document.querySelector('#ust-poll');poll.style.display ='inline-block';poll.style.transform ='translateX(-50%) scaleY(1)';functionclose() {poll.style.display ='none'; localStorage && (localStorage['ust-poll-closed'] =true); }document.querySelector('#ust-poll__close').addEventListener('click', close);functionclickedAnswer(e) {close();// Add a tag to the user like `poll_no` or `poll_yes`// You could also use addEvent instead to store more dataUST.addTag('poll_'+e.currentTarget.value); }var answers =document.querySelectorAll('.ust-poll__answer');for (var i =0; i <answers.length; ++i) { answers[i].addEventListener('click', clickedAnswer); } }})();
CSS:
Include this in a <style> tag or as an external CSS file.