# Install on Squarespace

Canonical: https://sourcetag.io/docs/install-squarespace

Add SourceTag's tracking script to your Squarespace site through the built-in Code Injection settings. No third-party apps or extensions needed.

## Step 1: Copy your script tag

In your SourceTag dashboard, go to your site's detail page and copy the script tag. It looks like:

```html
<script src="https://cdn.sourcetag.io/scripts/YOUR_SITE_ID/st.js"></script>
```

## Step 2: Open Code Injection

1. In your Squarespace dashboard, go to **Settings**
2. Click **Advanced**
3. Click **Code Injection**


## Step 3: Paste the script tag

1. In the **Header** section, paste the script tag you copied from SourceTag
2. Click **Save**

The script will now load on every page of your Squarespace site.

## Step 4: Publish

If your site is already live, the change takes effect straight away. If you're working on an unpublished version, publish your site to make the script active.

## Step 5: Test

Visit your live site with UTM parameters in the URL:

```text
https://yoursite.com/?utm_source=test&utm_medium=cpc&utm_campaign=squarespace-test
```

Open your browser's developer tools (F12 or Cmd+Option+I on Mac) and check:

1. **View page source** or the Elements panel to confirm the script tag is in the `<head>`
2. **Application > Cookies** to confirm a `_sourcetag` cookie has been created
3. Submit a form on your site. Check the form notification in Squarespace. The submission should include hidden fields with attribution data like `st_fc_channel` and `st_lc_channel`.

## Notes

- The script works with Squarespace's native form blocks. You'll need to add hidden fields to your forms yourself - SourceTag only populates fields that already exist. See [Add Hidden Fields](https://sourcetag.io/docs/fields-html) for the field names.
- If you're embedding a third-party form (Typeform, HubSpot, etc.) on a Squarespace page, the script will detect those too via MutationObserver.
- Browser cookies are limited to 7 days on Squarespace. There's no server-side cookie workaround available for Squarespace sites. See [Safari Cookies](https://sourcetag.io/docs/safari-cookies) for more detail.
- Code Injection is available on Squarespace Core plans and above. If you're on a Basic plan, you'll need to upgrade to access this feature.
