# Squarespace

Add ProductLense to a Squarespace site through Code Injection in the site header, on a plan that includes code injection.

Squarespace adds site-wide scripts through Code Injection, which prints into the `<head>` of every page. Code injection is available only on Squarespace plans that include it, so check your plan first.

## Add the script

1. In your site, open Settings → Advanced → Code Injection. On newer dashboards the same box is under Settings → Developer Tools → Code Injection.
2. Paste the two tags into Header. Replace `SITE_ID` with the id from Settings → Sites in the ProductLense dashboard.
3. Save.

```html title="Header" {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>
```

Add your custom domain, and the `.squarespace.com` address if visitors use it, to the site's hostnames in the ProductLense dashboard.

## Verify your installation

1. Open the published site in a normal browser window, signed out of Squarespace. Visits from the editor are not a reliable test.
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).
