# Install The Tracking Snippet

> Add a domain, paste one script tag, and verify that events are arriving.

Source: https://behavly.io/help-center/user-activity/install-the-snippet · Behavly Help Center · User Activity

Everything in User Activity, every behavioural audience in a campaign, and every number in Insights comes from one script tag on your site.

#### Add The Domain

1. Go to **User Activity → Setup** and press **Add source**.
2. Enter the domain you want to track. One tracked source per domain.
3. Behavly generates a **write key** for that source and embeds it in a snippet.

The snippet is a single async script tag:

```html
<script async src="https://behavly.io/t.js" data-pid="YOUR_WRITE_KEY"></script>
```

Paste it into the `<head>` of your site. It is `async`, so it does not block rendering.

#### Install It On Your Signed-In Pages

> Warning: The most common installation mistake is putting the snippet only on the marketing site. Behavly is about what your **signed-in users** do. If the snippet is not on your logged-in application pages, the Identified Users list stays empty no matter how much traffic you have.

#### Verify It

_The Setup tab. Each tracked domain shows its test status; the code icon in the Actions column copies that source's snippet._

Press **Test script**. Behavly polls until it sees one of two things: real events arriving from that write key, or the snippet present in your page's HTML. A source then shows one of four states.

| State | What it means |
| --- | --- |
| `Not tested` | The source was added but never verified. Behavly has not looked yet. |
| `Awaiting events` | Verified — the snippet was found — but no events have arrived. Normal for a minute or two after install; suspicious after an hour. |
| `Tested` | Verified and receiving events. This is the healthy state. |
| `Paused` | You stopped ingestion for this source. Existing data is kept; new events are dropped. |

Clicking a domain in the list opens analytics for just that source.

#### Identity

You do not call an identify function. The snippet detects a signed-in session on its own and attaches the activity to that person. There is no `behavly.identify()` step to wire up.

> Note: View-only members can read the tracked sites and their snippets, but cannot add, test or delete a source.

See also: https://behavly.io/help-center/user-activity/identified-users, https://behavly.io/help-center/troubleshooting/no-events-arriving
