> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usertick.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Usertick runs surveys on websites, by link, by QR code and by email, and collects every response in one inbox with reports, dashboards and workflows. The REST API lives at https://app.usertick.com/api/public/v1 and uses Bearer API keys or OAuth access tokens; the JavaScript SDK is the @usertick/snippet package on npm.

# Show a survey when a visitor clicks a button

> Open a website survey from your own Feedback button or link with the On element click trigger and a CSS selector, on every page of your site.

You can let visitors give feedback whenever they choose, from a button or link that is already on your site, such as **Feedback** in your footer or your app's menu. When you finish this guide, a click on that button opens the survey on any page of the site, as often as the visitor wants.

## Before you start

* Your site has the install code and shows **Connected** under **Settings → Sites**. See [Install Usertick](https://docs.usertick.com/installation.md).
* You have a CSS selector that matches only your button, such as `#feedback-button` or `[data-feedback]`. To find one, right-click the button in your browser, select **Inspect**, then **Copy selector**. If the button has no stable ID or class, ask your developer to add one.
* Your role has the **Manage surveys** permission.
* Starter and above include **On element click**, which counts as an advanced trigger, and the Free plan allows advanced triggers on 1 live survey at a time.

## Create the survey

1. On the **Surveys** page, select **Create survey**, then **Templates**.
2. Select the **Product feedback** template, which asks what the feedback is about, how satisfied the visitor is and what happened, and offers an optional screenshot.

Any website survey works the same way, so to use one you already have, open it in the editor.

## Open it from your button

In the editor's **Targeting** step, on **Triggers**:

1. Delete the template's **After a delay** condition with its trash icon, or the survey also opens 3 seconds after each page loads.
2. Select **Add condition**, then **On element click** under **Elements and forms**.
3. Enter your button's selector, such as `#feedback-button`, and the editor tells you if the selector isn't valid.

![The Triggers tab with one On element click condition whose selector is #feedback-button, followed by Then wait and Don't interrupt](https://mintcdn.com/usertick/b7hHAD5bKMN_XhRp/images/surveys-trigger-element-click.png?fit=max\&auto=format\&n=b7hHAD5bKMN_XhRp\&q=85\&s=63963ea39a71135969b8cb61f47bdda0)

Targeting → Triggers with On element click

## Let the button work every time

On **Display rules**, under **Show frequency**, set **Repeat behavior** to **Every visit**. With the default setting, **Until answered**, the button stops opening the survey once the visitor has answered, and after the visitor closes the survey, it waits until the next visit.

## Publish

In the **Publish** step, select the site under **Where it runs**, then select **Publish**. Visitors see the change within 5 minutes.

## How the button behaves

* A click opens the survey once per page view, and after the visitor closes it, the button opens it again on the next page or after a reload.
* A click on an icon or text inside the button counts, and so does a button that appears later, such as one in a menu that opens.
* [Page rules, devices and audience](https://docs.usertick.com/surveys/targeting.md) still apply, so the button opens the survey only where those rules allow it.

If your site has no button for this, choose **Side button** under **Survey → Appearance**, and Usertick adds its own tab on an edge of the screen. See [Display type](https://docs.usertick.com/surveys/design.md#display-type-website-surveys).

To open the survey from your own code instead, call `Usertick.trigger("feedback_clicked")` in the button's click handler and use a **Custom event** condition with the same name. See [Custom events](https://docs.usertick.com/surveys/triggers.md#custom-events).

## Check that it works

1. Open a page of your site in a private browser window and select your button, and the survey opens.
2. After you close the survey and open another page, select the button again, and the survey opens again.
3. After you answer it, the response appears in **Inbox**.

If nothing opens, check the selector in your browser's developer tools and see [Troubleshooting](https://docs.usertick.com/installation/troubleshooting.md).

## Related

* [Triggers](https://docs.usertick.com/surveys/triggers.md#the-conditions)
* [Targeting](https://docs.usertick.com/surveys/targeting.md#how-often)
* [Design and branding](https://docs.usertick.com/surveys/design.md#display-type-website-surveys)
* [SDK reference](https://docs.usertick.com/developers/sdk/reference.md)
* [Website surveys](https://docs.usertick.com/channels/website.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.