# Track your first visitor

Lessly Tracking tells you where your visitors come from and what those visits are worth. You paste one snippet into your site, it records what happens there, and you get attribution and revenue reports for your traffic and your ads.

This page takes you from nothing to your first tracked event. It takes one copy, one paste and one page reload.

## What you need first

Tracking works on one product at a time. Every domain, event, person and report you see belongs to the product you are working in.

| You need | Why | Where it comes from |
|---|---|---|
| A Lessly product | Tracking data belongs to a product | [Create and manage products](/products/products) |
| Tracking added to that product | It puts a `Tracking` entry in the product sidebar | A platform step, outside Tracking itself |
| Access to the product | Every Tracking page sits behind the product login | [Give someone access to a product](/access/product-access) |
| A website whose HTML you can edit | The snippet goes in the `<head>` of every page you track | Your site, your tag manager or your template |

Have the list of hostnames you want to track ready. You add each of them on the `Install` page and it is confirmed there once events start arriving from it.

Three things you do **not** need yet: a Google Ads account (only for [the Google Ads integration](/acquire/tracking/google-ads)), an API key (only for [events from your backend](/acquire/tracking/api-keys)), and a domain of your own for the snippet — it is served from the shared Lessly edge until you claim a tracking host.

## 1. Open the Install page

In the product sidebar, open `Tracking` → `Install`. The page has two steps: add the snippet, then verify that events are arriving.

Tracking opens on `Dashboard` and carries these pages: `Install`, `Live`, `People`, `Reports`, `Google Ads`, `Events`, `API keys` and `Tracking domain`.

## 2. Copy the snippet

The first block on the page is `Loader snippet`. Press `Copy`.

The snippet is generated for your product — it already carries your product's script URL, so there is nothing to fill in. One snippet covers the whole product, however many domains and pages it has.

There is also a `Minimal variant` behind the `advanced` toggle. Start with the loader snippet; [Install the tracking script](/acquire/tracking/install) explains why the shorter one is only safe if you never call `lt(…)` yourself.

## 3. Paste it into the `<head>` of your site

Paste the snippet into the `<head>` of every page you want to track, as close to the top as you can. Under the snippet, `Where are you installing?` gives the exact steps for the common cases:

| Where | What to do |
|---|---|
| Plain HTML *(Recommended)* | Paste it just before the closing `</head>` of the template that renders every page. |
| Webflow | `Project Settings` → `Custom Code` → `Head Code`, then publish. |
| WordPress | A header-snippet plugin (WPCode, Insert Headers and Footers), or your theme's `header.php`. Prefer the plugin — the snippet then survives theme updates. |
| Framer | `Site Settings` → `General` → `Custom Code` → `Start of <head> tag`, then publish. |
| Google Tag Manager | A `Custom HTML` tag with the `All Pages` trigger, then submit and publish the container. |

Google Tag Manager works, but it is the second-best option: the tag fires only after Google Tag Manager itself has loaded, so the earliest page views of a visit can be missed. Paste the snippet directly into the `<head>` whenever you can.

Then deploy or publish the change. The snippet only runs on the version of the site your visitors actually load — a snippet pasted into a builder and left unpublished does nothing.

> **Load it unconditionally.** Do not wrap the snippet in a consent check and do not insert it only after someone accepts. The script reads your banner's answer itself and falls back to a cookieless mode when statistics consent is declined or not yet given. Gating the tag hides declining and undecided visitors completely — see [What tracking does with a consent answer](/privacy/tracking-consent).

## 4. Load a page

Open any page of your site in a browser. That is your first tracked event: the script sends a `page_view` on load, with no further setup.

## 5. Watch it arrive

Back on the `Install` page, step 2 is `Verify your install`. Type the hostname you just loaded — `acme.com` — and press `Add`. The domain appears under `Registered domains`.

The page refreshes every 10 seconds on its own. The domain starts as `Waiting for events` and turns into `Script seen` as soon as an event from it reaches Tracking, with the time it was last seen underneath. A domain counts as seen if events have arrived from it in the last 30 days.

Two things are worth knowing here:

- Hostnames are matched exactly and `www` is not stripped. `acme.com` and `www.acme.com` are two different entries.
- If events arrive from a hostname you never added, it shows up under `Also sending events` with an `Add to checklist` button. That section is the quickest way to spot a typo in what you registered.

For the raw stream rather than a status badge, open `Live`. It shows events as they come in, refreshed every 5 seconds, with the page, the source and the visitor behind each one, and it tells you `Your first event just landed` the moment one does.

Your install is done.

## Record something of your own

The snippet defines a global `lt` function. Anywhere on your site, after the snippet, record what matters to you:

```js
lt('track', 'signup_completed', { plan: 'pro' });
```

The first argument is the command, the second the event name, the third an optional object of properties. The name is free-form; it shows up in `Live` straight away and in the catalog on the `Events` page.

## Put a name to the visitor

The script captures identity from form submissions on its own: when a visitor submits a form containing an email address — or a phone number in a field that is clearly a phone field — it records an identify event, and the anonymous visitor becomes a known person on the `People` page. Password and hidden fields are never read.

If your sign-up flow does not use a plain form submit, say so explicitly:

```js
lt('identify', 'ada@acme.com', { plan: 'pro' });
```

## Next steps

- [Install the tracking script](/acquire/tracking/install): the snippet's variants, what it collects on its own and how it sends it.
- [Record your own events](/acquire/tracking/events): naming, properties, the catalog and the live feed.
- [Send revenue from your backend](/acquire/tracking/revenue): the six lifecycle events and what makes someone a customer.
- [Read the attribution reports](/acquire/tracking/reports): which sources bring you customers and what they are worth.
- [Fix an install that sends nothing](/acquire/tracking/troubleshooting): symptom by symptom, if the domain never turns green.
