# Add CentPath to Wix

> Add the snippet to the head of every page as Wix custom code. Your site needs to be published with a connected domain.

Add CentPath to your Wix site as custom code, so every page of your published site counts its visits.

## Before you start

Wix adds custom code only to a published site with a connected domain, and connecting a domain takes a Wix Premium plan.

## 1. Copy your snippet

In CentPath, open your site, go to **Setup** → **Install** and click **Copy**. The snippet you copy holds your site's own id, so every visit counts for the right site:

```html
<script>window.analytics = window.analytics || Object.assign([], { q: [], goal: function () { this.q.push(arguments); } });</script>
<script defer src="https://centpath.app/script/p.js" data-site-id="YOUR_SITE_ID"></script>
```

## 2. Add it as custom code

1. In your site's dashboard, go to **Settings**.
2. Under **Development & integrations**, click **Custom Code**.
3. Click **+ Add Custom Code** and paste the snippet into the text box.
4. Name it `CentPath`, so you can find it later.
5. Under **Add Code to Pages**, pick **All pages**, and choose to load the code once per visit: the script counts each page change after that on its own.
6. Under **Place Code in**, pick **Head**.
7. Click **Apply**.

## Verify the setup

1. Open your live site on its domain in a new tab and load a page.
2. In CentPath, look under the steps in **Setup** → **Install**: **Waiting for your first pageview…** turns into **First pageview received.** once the visit arrives.
3. If it said **First pageview received.** before you started, your site has had visits already: look for this one in your dashboard instead. Reload it, and the visit shows in the **Visits** feed, usually within a minute.

[Check your installation](https://centpath.app/docs/verify-installation) shows more ways to check a page.

## Troubleshooting

### You can't find Custom Code, or can't add it

Your site needs to be published, with a connected domain. See [Before you start](#before-you-start).

### Visits from the editor don't show

Wix runs custom code only on your published site, never in the editor. Load your live site on its domain instead.
