Code demo

Trigger a survey after certain time on the website (during this browser session)

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.timeonsite.js"></script> <script src="https://dm.quicksearch.se/quicksearch.dialoglink.js"></script> <script src="https://dm.quicksearch.se/quicksearch.websurvey.js"></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" } }; // Show a 600x600 px survey with a header. // If the visitor has been prompted with a survey, dont do that again in 31 days var webSurveyConfig = { "Width": 600, "Height" : 600, "Header" : true, "Cookie" : true, "CookieName" : "QuicksearchSurveyFilter", "CookieDays" : 31, }; // This is the trigger: Set 3 seconds wait time visiting any page on the website (that has this script) Quicksearch.timeOnSiteRun(3, function () { Quicksearch.WebSurvey(Quicksearch.DialogLink("B832E9B6Z7050", dialogLinkConfig), webSurveyConfig) } ); </script>

Result

A survey will show after 3 seconds on this website (this page) and if it is shown, you will not see it again in 31 days

To reset the counter: Delete the cookies "QuicksearchSurveyFilter" (used for not showing survey in 31 days) and "QuicksearchTimeOnSite" (used for storing time on the website in this session)

Important! The script must be present on the pages that are included in the session time. If you have pages not using the script, they will not be included in the session time