Skip to main content

Embed: Add your OpinionX survey to your website or product with an iframe

Copy your survey's embed code from the Share window, paste it into any web page, and adjust its size, style and Hidden Fields.

Written by Daniel Kyne

🆓 Embedding is available on every OpinionX plan, including the free tier.

What is an embedded survey?

An embedded survey runs inside a page on your own website, help centre or product, so participants answer without leaving it. OpinionX gives you a short piece of code called an iframe (an HTML element that shows one web page inside another), which you paste into your page wherever you want the survey to appear.

Embedding is one of several ways to share a survey. The others are the survey link, a QR code, Email Invites, Unique Links and Hidden Fields. Every embedded response goes into the same results as responses from your other links, and OpinionX runs the analysis for you automatically, no manual work required.

This guide covers where to find the embed code, how to change its size and style, how to pass extra data into an embedded survey, how embedded Finish Pages behave, and how to add the code on popular website builders.

-- -- --

How to get your embed code

  1. Open your survey dashboard.

  2. Click the Share button in the top right corner. The Share survey window opens.

  3. Click Embedded Survey. The embed code is copied to your clipboard, and you'll see the message Copied embed code to clipboard.

  4. Paste the code into your web page.

The code looks like this, with your own survey link in place of https://app.opinionx.co/SURVEY_ID:

<iframe src="https://app.opinionx.co/SURVEY_ID" height="550px" width="100%" style="border: 1px solid lightgrey"></iframe>

The embed code always uses your survey's current participant link. If you've set a custom survey URL or a custom domain, the code uses those. If you change your custom URL later, embeds that use the old link keep working.

-- -- --

Changing the size and style

You can edit the code before you paste it. The three parts you're most likely to change:

  • height → how tall the survey window is on your page. The default is 550px. Taller blocks, like conjoint analysis, MaxDiff Analysis or a long Matrix Grid, are easier to answer with more room (for example 700px). If a page is taller than the window, participants scroll inside it.

  • width → how wide the window is. The default 100% fills the space you put it in, which also works on phones.

  • style → the border around the window. The default is a thin light-grey line. Use border: none to remove it, or add border-radius: 10px for rounded corners.

The survey inside the window uses your survey's own theme colours, logo and settings. To remove the OpinionX branding from the survey, see Whitelabeling.

-- -- --

Passing extra data into an embedded survey

Because the embed code is just your survey link inside an iframe, you can add URL parameters to the link inside src, the same way you would on a normal link:

  • Hidden Fields → record extra data about each participant, such as which page they came from or their role in your product. Add the field to your Enrichment Tab first, then add it to the link: ?source=website.

  • Language → open a multi-language survey in a specific language with ?lang= followed by the language code.

For example, this embed records role and source for everyone who answers it:

<iframe src="https://app.opinionx.co/SURVEY_ID?role=admin&source=website" height="550px" width="100%" style="border: 1px solid lightgrey"></iframe>

If your product already knows who the user is, fill these values in from your own code when the page loads. You can then filter and compare results by those values with segmentation analysis.

💡 If you embed the same survey in more than one place, give each embed its own source value. That way you can see which placement your answers came from.

-- -- --

What participants see when they finish

When an embedded participant finishes, they see your Finish Page inside the embed window. If your Finish Page redirects to another link, the Link Behavior setting decides where it opens:

  • Current Tab → the link opens inside the embed window, in place of the survey. Your own page stays around it.

  • New Tab → the link opens in a new browser tab, and your page stays as it is.

Neither option replaces your whole web page. If you want participants to move on from your page after the survey, use New Tab, or use a Static Page Finish Page with a message and a button.

-- -- --

How to embed your survey on popular website builders

Most website builders have a block for custom HTML. Add that block where you want the survey, then paste your embed code into it:

  • Squarespace → add a Code block.

  • WordPress → add a Custom HTML block.

  • Webflow → add an Embed element.

  • Wix → add an Embed HTML element (under Embed Code).

Some builders only show embedded content on the published page, not in the editor. If the window looks empty while you're editing, publish or preview the page to check it.

How to embed an OpinionX survey on a Squarespace website

Add a Code block to your page and paste your embed code into it. If you'd like rounded corners and a little more height, use this version, replacing https://app.opinionx.co/SURVEY_ID with the link from your own embed code:

<iframe src="https://app.opinionx.co/SURVEY_ID" height="650px" width="100%" style="border: 1px solid lightgrey; border-radius: 10px;"></iframe>

-- -- --

Tips before you publish

  • Test the survey first with Preview Mode. Answers given in Preview Mode aren't saved, but the embed uses your live link, so every test you submit through the embed counts as a real response.

  • Check the embed on a phone. Open your page on a mobile device and make sure the window is tall enough to answer comfortably.

  • Closing your survey closes the embed too. If you close your survey with Survey Status, the embed window shows the closed message instead of the survey.

  • Embedded responses count towards your participant limit like any other response. See participant limits.

-- -- --

FAQ

Is embedding free?

Yes. Embedding is available on every OpinionX plan, including Free.

Can I embed my survey on any website?

Yes. Any page that lets you add HTML can show the embed.

Do embedded responses go into the same results as my survey link?

Yes. An embed is your survey link inside an iframe, so every response goes into the same results, exports and segments.

Can I tell which responses came from the embed?

Yes, if you add a Hidden Field such as source=website to the embed link. Without one, embedded responses look the same as responses from your other links.

Will my embed break if I change my custom survey URL?

No. Old survey links keep working after you change your custom URL, so existing embeds still load.

Can I embed the survey as a pop-up or slide-in?

Not currently. OpinionX gives you a standard iframe. Some website builders and pop-up tools can show an iframe inside a pop-up, so you can paste the embed code into those.

-- -- --

Still stuck?

Reach out via the in-app live chat, book a survey setup call, or use the prepaid consulting credits included on the Analyze plan (90 minutes per year) and the Accelerate plan to work alongside one of our expert researchers.

Did this answer your question?