# Show a survey on your site

A survey works right away with its standalone address and QR code. To show it inside your site as a modal or a layer, add one more line for the survey module under the quiry install code.

## Install code and modules

quiry adds features to one install code as modules. The install code includes the inquiry widget and the basic `Quiry` functions. Features such as surveys load only on sites that include the module.

| Feature | Code to add | Name to call |
|---|---|---|
| Inquiry widget | Included in the install code | `Quiry.open`, `Quiry.identify`, and more |
| Survey | `quiry.me/m/form.js` | `Quiry.form` |

If you don't have an install code yet, do [Install the widget](/docs/install) first.

## Add the survey module

1. Find the quiry install code on your site.
2. Paste this line right below it. Add it once, to every page.

```
<script src="https://quiry.me/m/form.js" async></script>
```

Open your site once, then click **Check again** under **Install on site** at form.quiry.me. When a checked time appears next to the survey module, you're done.

## Open a survey

### Attach it to a button

You don't need code. Add `data-quiry-form` and the survey id to the element that opens the survey when clicked. The survey id is in the survey's **Share** window.

```
<button data-quiry-form="7Kp2xQ">Request a consultation</button>
```

### Open it from a script

```
Quiry.form.open("7Kp2xQ", {
  mode: "modal",
  values: { email: user.email, plan: "partner" },
  onSubmit: (r) => console.log(r.conversationId)
});
```

| Option | Value | Description |
|---|---|---|
| `mode` | `modal`, `layer`, `page` | A centered modal (full screen on phones), a layer that covers the site, or a move to the standalone address. The default is `modal` |
| `values` | Keys and values | Prefill by question key. Hidden questions are submitted with these values as they are |
| `onSubmit` | Function | Called when the submit finishes. It receives the response id and conversation id |

To close it, call `Quiry.form.close()`.

## Ask an AI

If you build your site with a tool like Cursor, Claude Code, or Lovable, give it the address of this chapter.

```
Read quiry.me/docs/form-install and add the survey module under the quiry install code.
When the "Request a consultation" button is clicked, open survey 7Kp2xQ as a modal, and prefill the email if the member is signed in.
```

## When it doesn't work

- **The survey doesn't open**: Check the browser developer tools console for a quiry message. Calling `Quiry.form` without the module tells you to add the module. Adding the module without the install code tells you the install code is needed first.
- **The survey is locked**: Free includes 1 survey. Visitors who open a locked survey see that it isn't accepting responses now.
- **It says the survey isn't accepting responses now**: In the survey's **Share** window, check whether **Who can submit** is set to **Not public**. Archived surveys don't accept responses either.

> You can also create surveys and read responses over MCP. The available tools are in [API tokens and MCP](/docs/tokens).

Next: [Responses and conversations](/docs/form-responses).
