New code in Publish survey dialog January 6, 2014
Happy new year. We have now updated the code provided by the Publish dialog. The new code looks like:
The first thing to note is that now the code is minified by default. This is with the idea that someone will simply copy and paste the code on their pages. Of course, this ignores all the options that are available docs.overresponse.com.
The new code has some other good things too:
- It will load asynchrously.
- It will write a container. Please note that although a container Id is provided, it will write a
divelement with that id.
In adition, the publish page now has the option to sample the survey to a fraction of your sites visitors. This is very direct: you select how many of your users want to show the survey to, and the dialog will wrap the code so that only selected users (by a
Math.random clause) will see the survey.
For instance, if you select '6% of visitors', the code for the same survey will look like: