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="https://survey.zef.fi/KEY/" 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
Embed
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 === 'https://survey.zef.fi') { // you have received a message from the survey // use message.data.type to get the message type // use message.data.data to get the message payload } }
Example code to listen for an event
Abstract models
Possible events