---
url: "https://questionstar.com/help/publishing/on-a-website/"
title: "Publish a survey on a website"
description: "Learn how to embed your QUESTIONSTAR survey into your website via link, iFrame, JavaScript or popup."
lastmod: "2026-07-08"
type: "help"
---

# Publishing a survey on a website

## About publishing a survey on a website

Technically speaking, an online survey or online questionnaire created with QUESTIONSTAR is an ordinary web page that's available to your respondents at its link. You can share this link among your respondents like any other web link, or embed it into your website. In this article, we explain the different methods you can use to integrate your online questionnaire — or the invitation to take part in your online survey — within your website.

## Publishing the survey link on your website

The simplest method to place the questionnaire into your website is to publish the link to the questionnaire on your website. You can do this with the "Insert Link" function of your content management system (CMS), or by entering a simple piece of HTML code.

Let's assume the link to your survey is **https://survey.questionstar.com/nps-beispiel**

You can then usually insert this link into the code of your website using your CMS's functions or by entering the following HTML code:

```html
<a href="https://survey.questionstar.com/nps-beispiel" target="_blank" rel="noopener">
    Click here 
</a>
```

And here's how this code then looks on your website: [Click here](https://survey.questionstar.com/nps-beispiel)

## iFrame method

A common method for displaying web pages (in this case, your online survey) within other web pages (your website) is to insert what's known as an iFrame ("inline frame") into your website. This means entering the following HTML code at the desired spot within your website:

```html
   <iframe width="800" height="521" style="overflow-y: scroll;" src="https://survey.questionstar.com/nps-beispiel"></iframe>
```

And here's what the result looks like:

*[Interaktiv:  — siehe HTML-Version der Seite]*

The drawback of this method is that you have to specify the width and height of the integrated web page in advance (the "width" and "height" properties in the HTML code above). But since the individual pages of the questionnaire typically vary in height, you may end up either reserving too little space for your questionnaire — so that your respondents have to scroll within the iFrame — or assigning too much space to the iFrame, so that the page with the questionnaire is perceived as unattractive by your respondent.

In this example, the height is set too short, so the respondent has to scroll to bring the button for submitting the questionnaire into view.

## Embedding the survey into your website

As an alternative to the iFrame method, you can embed your survey into your website using a JavaScript snippet. To do this, insert the JavaScript code at the appropriate spot on your website — the code you obtain on the "Embed" tab in the "Distribute Survey" view -> "Embed Code".

The advantage of this method is that, unlike with the iFrame, the height of the questionnaire integrated into the website always adjusts to the height of the questionnaire page being displayed.

The result looks like this:

*[Interaktiv:  — siehe HTML-Version der Seite]*

## Opening the survey in a popup

You can have your survey open in a popup window within your website. You can decide whether the popup should open automatically when the page loads or after a click on the link.

*[Interaktiv:  — siehe HTML-Version der Seite]*

## Displaying the invitation to take the survey in a popup dialog

Instead of embedding the actual survey into the website or displaying it in a popup window, you can have the invitation to take part in your survey appear in a popup. You can set whether the invitation should be shown immediately or after a certain amount of time.

In addition, the invitation popup remembers when visitors have declined the invitation and no longer opens for those visitors, so as not to disturb them.

You can also determine in the invitation settings how often and to what percentage of your visitors the invitation should be shown.

*[Interaktiv:  — siehe HTML-Version der Seite]*

## Displaying the invitation to take the survey as a button

You can have the invitation to take part in the survey displayed as a button. To do so, simply place the code snippet for the button embed at the desired spot on your website.

*[Interaktiv:  — siehe HTML-Version der Seite]*

## Displaying the invitation to take the survey as a feedback tab

Did you notice the feedback tab on the right edge of the page? This is also a handy way to invite your respondents to take part in the survey. Using the settings in the code snippet, you can determine whether the tab should appear on the right, left or bottom edge of the page.

![Feedback tab](/api/media/file/Feedback-Tab.png)

*[Interaktiv:  — siehe HTML-Version der Seite]*

## Code snippets for embedding the survey into your website

You can copy the code snippets for embedding a survey into your website directly from QUESTIONSTAR.

![Code snippets](/api/media/file/Snippets.png)

To do so, proceed as follows:

1. Switch to the "**Distribute Survey**" view.
2. In the menu on the left, select the item "**Embed Code**".
3. Decide on one of the embedding methods offered:**Embed** (direct integration)**Button** (integration via a click on a button)**Invitation** (subtle prompt to take the survey)**Feedback tab** (edge-of-page tab to take part)**Modal** (popup dialog)
4. Choose between "**Simple**" and "**Advanced**":The simple code offers a quick standard integration.The advanced code offers additional options for customizing the embed as well as for managing events.
5. Use the eye icon ("Preview") to get a direct preview of the integration and to get an impression of how the embed will look on your website.
6. Copy the desired code to your clipboard using the "**Copy Embed Code**" button, then paste it at the desired spot on your website.
7. In addition, you have the option to define a different layout template specifically for this embed. This is useful, for example, if you want to integrate a small feedback survey (e.g. about a blog article) into the natural reading flow and prefer a layout without a header and progress bar for it.

If you want more control over the embed code settings, read our help article [Embed Code: Advanced Settings](/help/publishing/embed-code-advanced-settings).
