# Sites

Sites are the domains SleekTrack collects data for. You can track the
WordPress install that runs SleekTrack, any number of external sites, or both.

## The Sites screen

**Sites** shows every tracked site as a card with its visitor-day trend and
its visitors over the last 30 days, plus its revenue when it recorded any.
Sites in a group are listed under the group's name, with the group's
visitors over the last 30 days beside it; the rest are listed under
**Ungrouped**. Click a card to open that site's dashboard, or a group's name
to open the group's dashboard. With more than one site, **All sites** opens a
dashboard that rolls up every tracked site. Before the first site exists the
screen says so, with **Create site**.

## This site

When SleekTrack is activated on a single site, it registers that install as
its own tracked site and adds the tracking code to its pages automatically, so
there is no snippet to paste. If the install is not tracked, for example
after you deleted it, **Create site** offers **Track this site** to add it
back the same way.

The tracking code is not added for logged-in users whose role is turned on in
**Excluded roles** in the [collection settings](/docs/track/configuration.md).

## Adding a site

1. Open **Sites** and click **Create site**
2. Enter the **Domain**, for example `example.com`, an optional **Name** and
   an optional **Group**
3. Click **Create site**; the site's **Snippet** section opens. Copy the
   snippet
4. Paste the snippet into the `<head>` of the site you want to track
5. Purge the site's page and CDN caches, open its dashboard and click
   **Check installation**

The domain is normalised: the protocol, any path or port, and a leading
`www.` are removed. It must be a public domain name with a top-level domain,
and each domain can be added only once. [Snippet](/docs/track/snippet.md)
explains the snippet and the installation check.

## Groups

Groups collect sites, for example per client. Choose **New group…** in the
**Group** field when you create a site or edit its settings and name the new
group; it is created when you save.

A group's dashboard rolls up its sites, with an extra **Sites** card that
breaks the totals down by site; click a site there to filter the dashboard to
it. Beside the dashboard, a group's navigation holds **Settings**, where you
rename the group, give it a colour, or delete it with **Delete group**, and
**Email reports**, which sets its [email report](/docs/track/email.md#reports).
Deleting a group asks first; it keeps its sites and their data, and they
become ungrouped.

## Site settings

Beside a site's **Dashboard**, its navigation holds five sections: Settings,
Sharing, Snippet, Email reports and Import. Roles that only view Track see the
dashboard alone. A link to a section opens it directly, such as
`#/track/site/12/snippet`.

### Settings

- **Name** and **Domain**, which can be changed at any time
- **Group**, the group the site belongs to
- **Collect analytics**: a site that does not collect keeps the data it has
- **Combine subdomains**: traffic from subdomains that are not tracked as
  sites of their own counts as part of this site. A subdomain added as a site
  of its own keeps its traffic separate, and records none while that site
  does not collect
- **Record heatmaps**: records where visitors click on each page, for the
  [heatmaps](/docs/track/dashboard.md#heatmaps) of the **Top pages** card. Off
  until turned on; see [Privacy](/docs/track/privacy.md#heatmaps)
- **Webhook URL** and **Webhook secret**: see
  [Goal webhooks](/docs/track/events.md#goal-webhooks). A URL needs a secret.
  A saved secret stays masked; **Replace** enters a new one and **Remove**
  deletes it after asking
- **Delete site** removes the site with all of its events, daily totals,
  goals, funnels, annotations and share links, after asking. This cannot be
  undone

**Discard** drops the changes you have not saved; **Save** saves them.

### Import

**Import daily history** takes a CSV file with `date` and `visitors` columns,
such as a Plausible or Fathom export, and imports it into the site's daily
trends. A pageviews column and a visits column are imported when the file
has them; otherwise pageviews and visits default to the visitor count. Dates
use the `YYYY-MM-DD` format, only days before today are imported, and a file
can hold up to 5,000 days. Importing a day again replaces its imported totals.

Imported days appear in the charts, the totals and the Sites screen. They have
no pages, sources or other breakdowns, because the file holds only daily
totals.

### Sharing

Creates and revokes share links to the site's dashboard. See
[Share links](/docs/track/sharing.md).

### Snippet

Shows the site's tracking snippet, ready to copy. For the install that tracks
itself, the section notes that Track adds the snippet for you and shows it for
reference only.

### Email reports

Sets the site's [email report](/docs/track/email.md#reports) and
[visitor spike alert](/docs/track/email.md#visitor-spike-alerts).

## Data retention and daily totals

SleekTrack keeps raw events for the retention window set in the
[collection settings](/docs/track/configuration.md#data-retention), 365 days by
default. Daily totals are kept beside them, so pruning old events does not
erase the trends: the charts and totals of older days still show, but their
breakdowns are gone.
