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.

<iframe src="" width="100%" height="640px" hspace="0" vspace="0" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" style="min-width: 320px; max-width: 960px" onmousewheel=""></iframe>
Make sure to replace the `KEY` with your web embed key that you get when you create a web embed

Survey communication

Make your embed or popup talk with your website by listening to events.

Note: Make sure to specify an origin in Zeffi, otherwise no event will be sent. You can find this under the advanced settings of your embed or popup.

The wildcard (*) is allowed, but strongly discouraged.

Read more here about the proper usage.

window.addEventListener('message', onMessageReceived); function onMessageReceived(message) { if (message.origin === '') { // you have received a message from the survey // use to get the message type // use to get the message payload } }
Example code to listen for an event
Abstract models
Possible events