How do I embed my survey into my website?

The most important part of any survey is having your audience participate in it. There are various ways of distributing the survey, and they can all be found by hovering over the title of your survey in your dashboard and clicking Collect Responses:

Collect Responses

Website Popup

The most flexible embed method, the website popup offers several ways to embed a link to your survey into your website.

Website Popup

You have the choice of embedding a button, banner, or slider popup that when clicked, will bring up your survey in a popup window.

Clicking on each of these will show settings for that type of embed. At the bottom of each settings section are the codes that you copy and paste into your website:

If you are using WordPress.com then you can paste the WordPress.com shortcode:

Otherwise, copy the JavaScript embed:

JavaScript embeds are explained in more detail below. Note that you must paste the JavaScript code as plain text. If you paste the code into a visual editor then it will display on your website as code.

Note that your website must contain a valid non-quirks mode DOCTYPE. If you don’t know what this then it probably contains one!

Button embed

The simplest website embed is the button embed, with an option for rounded or square corners. You can also choose to have a plain text link. You can change the text that appears, the style of the text, and the colors. The preview area will show you what the embed code will look like. When a participant clicks the button or the link, the survey will appear in a popup window.

Banner embed

A banner displays an image in one of the corners or the left or right side, of your blog. As with the button, you can change the text and colors, as well as style (corner or side), and alignment (which corner or side). When a participant clicks on the banner, your survey will appear in a popup window.

Slider popup

The slider popup is a more interactive method of embedding and will display a small dialog that slides onto the page. You can change the title, body, and button text. When a participant clicks on the slider popup’s button, the survey will appear in a popup window.

Website inline

You can also embed your survey directly into the body of your webpage, with the website inline option:

Website Inline

The website inline method has three different types of embed codes: iframe, auto-resizing iframe, and WordPress shortcode:

Inline

Advanced JavaScript Embeds

You have additional options available with JavaScript embeds.

Can I include multiple embeds on one page?

Absolutely. To make this as efficient as possible, only add the first line of embed code once on your page, and the subsequent lines wherever you want the embed. For example, an embed code looks like this:

<script type="text/javascript" src="http://i0.poll.fm/survey.js" charset="UTF-8"></script>
<noscript><a href="http://polldaddy.com/s/C743BAD48293B0B2">Take Our Survey!</a></noscript>
<script type="text/javascript">
  polldaddy.add( {
    type: 'slider',
    title: 'Take Our Survey!',
    body: 'Please help us find out what you think by taking our survey at Polldaddy.com.',
    button: 'Get Started &raquo;',
    pid: 'C743BAD48293B0B2'
} );
</script>

The first line has been highlighted. This only needs to occur once on your page. The other lines need to occur once per embed. Using this method you will save your users from having to download the Polldaddy code for each embed.

Can I have the survey appear when I click on something else?

Yes, you can make use of the polldaddy.launch() JavaScript function anywhere on the page. For example, to have a link start the survey:

<a onclick="return polldaddy.launch(this);" href="http://polldaddy.com/s/AD28274479EBCD28">Apply Now</a>

Can I change how the slider appears on screen?

You can change the time before the slider appears (delay), and speed at which it appears, when calling polldaddy.add:

polldaddy.add( {
  type: 'slider',
  delay: 2000,
  speed: 1500
} );

The values are in milliseconds.

My survey only appears once, can I change that?

By default the embed will only show to a user until they click on it, at which point it will not show again. This is designed to reduce any annoyance to the user by showing them something they’ve already completed. You can change this behaviour with the visit: 'multi' parameter:

polldaddy.add( {
  visit: 'multi'
} );

This can be combined with all other parameters.

Can I seed values and add custom survey tags?

You can add seed values and survey tags as follows:

<script type="text/javascript">
  polldaddy.add( {
    type: 'slider',
    title: 'Take Our Survey!',
    body: 'Please help us find out what you think by taking our survey at Polldaddy.com.',
    button: 'Get Started &raquo;',
    pid: 'C743BAD48293B0B2',
    tags: {
      tag_name: 'tag_value',
      tag_name2: 'tag_value2'
    },
    seed: {
      q_1_email: 'test@example.com',
      q_2_url: 'example.com'
    }
} );

Can I detect when a new survey page is displayed?
Yes, you can pass a callback function into any resizing IFRAME embed. This function will be fired whenever a survey page is displayed. You can use this to make changes on your surrounding page such as rotate adverts, or trigger page views.

polldaddy.add( {
 type: 'iframe',
 auto: true,
 domain: 'example.polldaddy.com/s/',
 id: 'new-survey',
 callback: your_call_function
 } );

How do I prevent my auto-resizing embed from scrolling

You can pass an extra scroll option:

polldaddy.add( {
 type: 'iframe',
 auto: true,
 domain: 'example.polldaddy.com/s/',
 id: 'new-survey',
 scroll: false
 } );
Polldaddy Tweets
%d bloggers like this: