# Wix

Add ProductLense to a Wix site from Settings → Custom code, placed in the head of all pages and loaded once.

Wix adds third-party scripts through its Custom code settings. Wix only runs custom code on sites with a connected domain on a premium plan, so check that first.

## Add the script

1. In the Wix dashboard of your site, open Settings → Custom code (under Advanced).
2. Click Add Custom Code and paste the two tags below. Replace `SITE_ID` with the id from Settings → Sites in the ProductLense dashboard.
3. Under Add Code to Pages, choose All pages and Load code once.
4. Under Place Code in, choose Head.
5. Apply, then publish the site.

```html title="Custom code" {1-2}
<script>window.productlense=window.productlense||function(){(window.productlense.q=window.productlense.q||[]).push(arguments)}</script>
<script defer data-site="SITE_ID" src="https://api.productlense.app/a.js"></script>
```

Wix moves between pages without a full reload, and the script records those route changes as pageviews. Add your connected domain, and the `www` form if you use it, to the site's hostnames in the ProductLense dashboard.

## Verify your installation

1. Publish, then open the live site on its connected domain in a normal browser window. The Wix editor and preview do not run custom code.
2. Open the Live page in the ProductLense dashboard. Your visit appears within a few seconds.
3. In the browser's developer tools, the Network tab shows a `POST` to `https://api.productlense.app/api/e` with status `204`.

Ad blockers in your own browser may block the request. If the visit does not appear, follow [Verify your installation](/docs/install/verify).
