# Add Privatus Analytics to Webflow

> Add privacy-friendly analytics to Webflow through site-wide custom code, handle your webflow.io staging domain and track events with custom attributes.

1. Open your project and go to **Site settings → Custom code**.
2. Paste the snippet into **Head code**:

   ```html
   <script defer src="https://privatusanalytics.com/js/pa.js" data-site="pa_YOURSITEID"></script>
   ```

3. Save and **Publish**. Custom code only runs on the published site, not
   in the Designer.

## Staging domain

Your `*.webflow.io` staging domain isn't one of your site's domains, so its
hits are dropped. That's usually what you want. To measure it, add it as an
extra domain, or restrict tracking to production explicitly with
`data-domains="example.com,www.example.com"`.

## Events without code

Webflow lets you add custom attributes to any element (**Element settings →
Custom attributes**). Add:

| Name | Value |
|---|---|
| `data-privatus-event` | `Demo request` |
| `data-privatus-prop-plan` | `business` |

On a form block, the event fires when the form is submitted. See
[HTML attributes](/docs/events/html-attributes).
