> ## 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.

# Install on your website

> Add the Usertick script tag to a site, check the install and see how the widget behaves on the page.

Website surveys run from one script tag per site. The tag loads asynchronously, the widget renders inside its own Shadow DOM, and when Usertick can't be reached the page loads as usual without the widget.

## Copy the install code

Every site has its own install code, and **Settings → Sites** shows each site as a tab.

**1. Open Sites**

Go to **Settings → Sites**.

**2. Add the site**

If the domain isn't listed yet, select **Add site**, enter its **Website address** and select **Add site** again.

**3. Copy the code**

Open the site's tab and select **Copy** on the code.

A site that is still waiting for its code opens first and shows the code right away. On a connected site, the code and the ways to hand it on stay folded until you select **Show code**.

The code is one tag, and its file name is the site's ID:

```html theme={null}
<script async src="https://cdn.usertick.com/s/YOUR_SITE_ID.js"></script>
```

> [!WARNING]
>
> Don't edit the code. The site ID ties it to one site, and the widget runs only on that site's domain and its subdomains.

## Add the code to your site

Paste the tag into the `<head>` of every page where the widget should run:

```html theme={null}
<head>
  ...
  <script async src="https://cdn.usertick.com/s/YOUR_SITE_ID.js"></script>
</head>
```

The site's tab also has three ways to get the code onto the site without doing that by hand:

* **Ask an AI assistant** opens a new chat in ChatGPT, Claude or Cursor with the request already written: the tag, the site's domain and where the tag goes. **Copy prompt** copies the same request for any other assistant.
* **Send to a developer** emails the tag and the steps to an address you enter. Usertick sends the email itself and names you as the person who asked, and the developer doesn't need a Usertick account. A site can send 5 of these emails per hour, and the row shows only for members whose role has the **Manage sites** permission.
* **Other ways to install** opens with **Show all**. It shows the npm code for React, Next.js, Vue, Nuxt, Angular, Svelte, Astro, Remix and Gatsby, and links to the [platform guides](https://docs.usertick.com/installation/platforms.md).

### Platform guides

On a website builder, a store or a tag manager, the tag goes into that platform's own setting for head code. [Platform guides](https://docs.usertick.com/installation/platforms.md) has the steps for each one.

| Kind | Platforms |
| - | - |
| Website builders and stores | WordPress, WooCommerce, Shopify, Webflow, Wix, Squarespace, Framer, Ghost, HubSpot, BigCommerce, Magento, Bubble, Carrd, Unbounce, Joomla |
| Tag managers | Google Tag Manager, Adobe Tags, Matomo Tag Manager |

In a single page app, either the script tag or the npm package works. Both follow client-side route changes. See [Install with npm](https://docs.usertick.com/installation/npm.md).

## Check the install

**1. Open the site**

After the code is live on your site, go to **Settings → Sites** and open the site's tab.

**2. Check the install**

Select **Check now**.

Usertick loads `https://<domain>/` and looks for the site's tag in the HTML the page returns. When the tag is there, the site's status changes from **Waiting for the code** to **Connected**. A website survey can be published only after its site is connected. The check can run again after 10 seconds. On a connected site, and after a check that didn't find the code, the button reads **Check again**. The button shows only for members whose role has the **Manage sites** permission.

When the check doesn't find the code, its answer stays at the top of the site's tab:

| Message | Cause |
| - | - |
| "Usertick loaded `<address>` and didn't find the code. Paste it on every page, publish the change, then check again." | The home page has no Usertick tag |
| "`<domain>` has the code of a different site. Use the code shown here." | The tag on the page belongs to another site |
| "Usertick couldn't load `<domain>`. Make sure the site is online over HTTPS, then check again." | The site didn't answer over HTTPS, or it returned an error |
| "`<domain>` redirected to an address Usertick can't check. Point the domain directly at the site, then check again." | The home page redirects to another domain or to plain HTTP |
| "The site couldn't be checked right now. Try again in a few seconds." | The check couldn't run, for example because it was repeated within 10 seconds |

> [!NOTE]
>
> The check reads the HTML of the home page only. When Usertick is added through a tag manager or the npm package, the tag isn't in that HTML, so the check can't find it. In that case, also add the script tag to the home page. The tag and the package share one widget on the page, so a survey never shows twice.

The check also can't find the tag while the home page isn't the page visitors will get: a site in a website builder that hasn't been published yet, or a Shopify store that still shows its password page.

To see a survey on the site, publish a website survey for it and open a page that matches the survey's targeting. If nothing appears, see [Troubleshooting](https://docs.usertick.com/installation/troubleshooting.md).

## How the widget behaves on the page

* The tag has `async`, so the page never waits for it.
* The widget renders inside a closed Shadow DOM. Your CSS doesn't reach the widget, and the widget's CSS doesn't reach your page.
* The widget runs only on the site's domain and its subdomains. On any other host, it shows nothing.
* The site's code file carries its live surveys. Browsers can keep the file for up to 5 minutes, so a survey that was just published, edited or paused can take up to 5 minutes to change for a visitor who already had the page open.
* When a response can't be sent because of a network error, the widget keeps it in the browser and retries in the background and on later page loads. A response that still hasn't been sent after 7 days is discarded. When the survey has a closing date, a response given before the survey closed is accepted only when it arrives within 3 days of the close.


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