Embed Your Survey On Your Website Using JavaScript

Alchemer's embed options allow you to easily include your surveys directly on your own website. In this tutorial, we'll cover how to set up the JavaScript embed option. 

The JavaScript Embed will embed your survey using JavaScript code. If you don't like the isolated frame that displays with the iFrame Embed, then this is the embed for you!

JavaScript Embed Example

When should I use a JavaScript Embed?

If you wish to have your survey inherit the styles of your website, the JavaScript embed is the best option! The JavaScript embed will also capture URL variables that have been appended to the parent/host webpage's URL.

  1. To obtain the embed code to create a popup on your website, go to the Share tab of your project, click the link for Embedded Survey (located on the bottom-half of the Share page).Embedded Survey
  2. Select Javascript and copy and paste the code on your website. 
  3. If you would like, you can select the Do not include theme styles option to ensure your survey blends in with your website.

Private Browsing via Safari or Firefox as well as non-private browsing in Safari during survey taking on JavaScript embedded surveys return respondents to the top domain (home page) of a website. This is due to browser settings. Alchemer recommends respondents utilize non-private browsing in FireFox, or using Google Chrome during survey taking.

Making Customizations to Your Embed

If you'd like to make customizations to your embed you'll need to create a dedicated embed link. To do so, click the Create New Tracking Link button. As this option indicates, this will also allow you to track and segment responses by campaign.

Give your dedicated link a name and go to the Advanced tab. From here you have the following options:

  • Duplicate Cookie Protection - By checking this option, it will place a cookie on the respondent's browser that will stop them from answering the survey more than once using this embed. If they clear their cookies, however, they will be able to take the survey using this embed link again. For more advanced duplicate protection, please go to your Advanced > Response Settings tab.
  • Quota - This option allows you to limit the total number of responses this particular embed link will record. Once that quota is met, your respondents will no longer be permitted to submit their response.
  • URL Variables - This option allows you to automatically pass unique URL variables through the embed link for each respondent that accesses the survey. Format this as a query string, without a leading '?' or '&'.
  • Language - If you have multiple languages in your survey, you can choose which language will display by default in this particular embed. If you choose "auto" the system will automatically detect the language of the browser the respondent is using and display that option if it's available. If not, it will default to English.

To share this link click the Share dropdown and select the method you wish to use to share.

Share Options

JavaScript Embed: What Does It Look Like?

Below is a Demo JavaScript Embed of a Website Event Feedback Survey.

JavaScript Embed and reCAPTCHA

If you plan on using a reCAPTCHA on surveys that are embedded on your website, you will need to register your website/domain with Google's reCAPTCHA service. Visit the reCAPTCHA documentation to learn more.

Limitations

  • File Upload questions will not work with JavaScript embeds.
  • Cascading Drop Down questions are not compatible with JavaScript embeds.
  • The Language Bar is not compatible with the JavaScript embed.
  • The Delay Setting for URL Redirects is not compatible with the JavaScript embed.
  • The survey counter merge code is not compatible with embedded surveys.
  • Single Sign-On for survey respondents is not compatible with embedded surveys.

Basic Standard Market Research HR Professional Full Access Reporting
Free Individual Team & Enterprise
Feature Included In