Code demo

Trigger a website survey - including background data. Triggering additional script when finishing.

The demo uses either an anonomous web survey link or a web survey link including background information.

Code

<!-- put in head --> <link href="https://dm.quicksearch.se/quicksearch.websurvey.css" rel="stylesheet"> <!-- /put in head --> <script src="https://dm.quicksearch.se/quicksearch.dialoglink.js"></script> <script src="https://dm.quicksearch.se/quicksearch.websurvey.js"></script> <!-- sample third party script --> <script src="confetti.js"></script> <style> #confetti-canvas { position: absolute; top: 0; left: 0; } </style> <!-- /sample third party script --> <script> var dialogLinkConfig = { "data" : { "first_name" : "John", "last_name" : "Doe", "mobile_phone" : "555-123456", "extraField1" : "Summer campaign", "extraField2" : "Product1;Product2;Product3", "extraField3" : "Good customer" } }; var webSurveyConfig = { "Width": 600, "Height" : 600, "Percentage" : 50, "Header" : true, "Cookie" : false, "CookieName" : "MySurvey", "CookieDays" : 0, "Delay" : 2, "CloseDelay" : 5, "onButtonClose" : function() { console.log("Clicked close-icon"); }, "onClosed" : function() { console.log("Closed"); }, "onFinished" : function() { console.log("Finished!"); startConfetti(); setTimeout("stopConfetti()", 5000); } }; Quicksearch.WebSurvey(Quicksearch.DialogLink("B832E9B6Z7050", dialogLinkConfig), webSurveyConfig); </script>

Result

A 600px x 600px survey will pop up on approx 50% of the page loads on this page 2 seconds after the page is loaded and survey will close 5 seconds after being finished showing some confetti.

Web survey settings