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 website popup is the most flexible embed method. It offers several ways to embed a link to your survey into your website.

Website Popup

You have the choice of embedding a button, a banner, a slider popup that brings up your survey in a popup window once it gets clicked, or a slider choices.

polldaddy survey embedding website pop up choices

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 can copy and paste into your website.

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

Please note that the shortcode can also be used on WordPress sites that have the Polldaddy plugin installed.

If you are using WordPress.org and don’t have the Polldaddy plugin installed, you can copy the JavaScript embed:

polldaddy embed survey javascript code

JavaScript embeds are explained in more detail below. Please 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.

Important! In order to make the Javascript embed work, 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/call to action of the survey, 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.

polldaddy survey embed button

Banner embed

A banner displays an image in one of the corners of your blog – on the left or right side. 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 / Slider Choices

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 four different types of embed codes: iframe, auto-resizing iframe, the WordPress shortcode and the Javascript embed:

polldaddy embed survey website 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.

The first line of an embed code looks like this:

(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/survey.js':'http://i0.poll.fm/survey.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-embed'));

Place this line once on your page, and put the other lines of the embed code wherever you want to show a survey. For example:

(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/survey.js':'http://i0.poll.fm/survey.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-embed'));

<div class="pd-embed" id="pd_1491585212"></div>

<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0A%20var%20_polldaddy%20%3D%20%5B%5D%20%7C%7C%20_polldaddy%3B%0A%0A%20_polldaddy.push(%20%7B%0A%20type%3A%20%22iframe%22%2C%0A%20auto%3A%20%221%22%2C%0A%20domain%3A%20%22example.polldaddy.com%2Fs%2F%22%2C%0A%20id%3A%20%22test-survey%22%2C%0A%20placeholder%3A%20%22pd_1491585212%22%0A%20%7D%20)%3B%0A%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="&lt;script&gt;" title="&lt;script&gt;" />

<!-- some text goes here on your web page-->


<div class="pd-embed" id="pd_1491585211"></div>

<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0A%20var%20_polldaddy%20%3D%20%5B%5D%20%7C%7C%20_polldaddy%3B%0A%0A%20_polldaddy.push(%20%7B%0A%20type%3A%20%22iframe%22%2C%0A%20auto%3A%20%221%22%2C%0A%20domain%3A%20%22example.polldaddy.com%2Fs%2F%22%2C%0A%20id%3A%20%22example-survey%22%2C%0A%20placeholder%3A%20%22pd_1491585211%22%0A%20%7D%20)%3B%0A%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="&lt;script&gt;" title="&lt;script&gt;" /></pre>
<pre>

 

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: