Make sure your survey is in Published state. The embeddings are disabled if the survey is in Unpublished or Offline state.
Embedding via iframe
You can embed the survey via iframe using the following sample code.
To create a popup survey, put the following script inside your page header tag.
<script src="https://zef.fi/s/zeffi.js?key=KEY1,KEY2,KEY3" async defer></script>
Make sure to replace the `KEY*` with your survey's popup key that is generated when you create a new popup. You only need as many keys as the number of surveys you wish to add as popups.
zeffi.openPopup()Opens the survey popup. In case of multiple keys, the first survey is opened.
zeffi.openPopup(KEY)Opens a specific survey popup, identified by the KEY. There can only be one survey opened at a time, this closes any other survey if currently open.
zeffi.closePopup()Closes the currently open popup.
zeffi.togglePopup()Toggles the open / close state of the popup. In case of multiple keys, the first survey is opened.
zeffi.togglePopup(KEY)Toggles the open / close state of the popup. When opening, the specific survey is opened identified by the KEY.
zeffi.showBubble()Shows the clickable bubble. In case of multiple keys, clicking the bubble opens the first survey.
zeffi.showBubble(KEY)Shows the clickable bubble. Clicking the bubble opens the specific survey identified by the KEY.
zeffi.hideBubble()Hides the clickable bubble if visible.
Note: Without bubble the user cannot open the popup, and it needs to be opened via code.