SurveyMonkey

Embedding Your Survey or Form on a Website

Use a website collector to embed a survey or a button that opens a survey on your website, or popup a survey or invitation. To add one, you only need a basic understanding of HTML and access to your website’s source code. We’ll give you an embed code you can copy and paste.

You can embed a survey on multiple pages of your site, if you want.

TypeDescription
Embedded surveyEmbed your survey on any page of your site so people can take it right there.
Embedded button Beta feature: Embed a button on your website that launches your survey when selected.
The button continues to display on your site even after someone took the survey.
Popup invitationShow a survey invitation in a popup window that links people to your survey. The survey opens in a new browser tab.
Popup surveyShow your survey in a popup window when people visit a page, without needing to embed the survey in the page layout.

Popup Invitations and Popup Surveys show in modal windows that float above your webpage. Modal windows don't require your site visitors to load a new page, and they aren't affected by popup blockers.

We use cookies to stop popups or embedded surveys from reshowing if someone already answered, declined, or closed the survey. If someone clears their cookies, visits your site using a browser that blocks or disables cookies, or the website is opened in a new browser session, the collector can’t remember whether they’ve taken the survey or declined it, so the popup may appear again allowing additional responses.

When you close your survey, it continues to display on your website, unless you remove the embed code from your site.

To create a Website collector:

  1. Go to the Collect Response section of your survey.
  2. Choose Embed on a site. If you already have a collector for your survey, select Website collector.
  3. Choose a website collector type.
  4. Scroll down to edit the the style and behavior settings, and adjust the collector options. View the preview to know what your survey will look like on your website.
  5. Click Copy Code to copy and paste the embed code onto a page in your site.
    • When embedding a survey or button, paste the script into your HTML wherever you want the survey to appear on your page.
    • When showing a Popup invitation or Popup survey, paste the script into your HTML immediately before your closing </body> tag.

The code only needs to be added once. You don’t need to update the Embed code if you make changes to your survey or collector—your updates will display as soon as you refresh the page.

The live survey preview updates as you customize your style and behavior settings for your survey.

Settings vary by website type.

SettingDescription
Width and HeightSpecify how many pixels wide or tall you want the survey to be.
When using the Embedded survey type, turn on the Custom size toggle to access these settings. If you leave the toggle off, your survey will match the width of the HTML element containing your survey or form.

SurveyMonkey branding
You may see a toggle or checkbox which controls whether "powered by SurveyMonkey" displays on the bottom border of your survey.  

If you remove the SurveyMonkey branding, you may also want to remove SurveyMonkey branding from the survey itself.
Border or Footer

Edit the border color of the window or footer to help your invitation or survey stand out.
Invitation or Survey headlineCatch your visitor’s attention with a headline that’s no more than 2 lines. You can edit the text, but not the font, size, or color.
Invitation messageExplain the goal of the survey in 1 – 3 short sentences. You can edit the text, but not the font, size, or color.
Primary buttonThis Popup invitation button opens your survey. You can edit the button text, button color, and button text color.
Secondary buttonThis Popup invitation button closes the invitation window. You can edit the button text, button color, and button text color.
Sample RateChoose the percentage of visitors to see your Popup invitation or popup survey.
Embed button The button embedded on your page that opens your window. You can edit the button label, color, and text color.
Popup labelThis is the text introducing your popup survey.
BehaviorChoose whether to show the popup immediately, after a delay (measured in seconds), after the visitor scrolls a specific percentage down the page, or when they’re about to leave your page.

Update the collector options, which are called Settings on the Embedded button type, to customize the survey experience. Some collector options are limited on certain website collector types:

  • Embedded surveys don't have a Survey end page option.
  • Instant results aren't available on any website collector type.
  • The Custom thank you includes SurveyMonkey branding at the end of an Embedded survey, even if you chose to Hide SurveyMonkey Branding.

Please don’t edit the Embed code! The Embed code contains several lines of JavaScript and a unique ID that's tied to both your collector and your survey.

You can paste the embed code on a single or multiple pages by pasting the embed code before the </body> tag. If you want all pages of your site to display the survey, button, or invitation, paste the embed code before the </header> tag.

If you use templates to dynamically generate pages for your site (if you’re using Ruby, Python, PHP, ASP, or a similar technology), you can paste the Embed code snippet into its own file, then include it in your page layout.

If you’re using wordpress.org, you need to be an administrator to add the code, or a super admin for multi-site wordpress.org networks. Website collectors aren’t compatible with wordpress.com.