Skip to content

Tracking

Track your first visitor

Get from an empty product to a tracked event on your own site: one copy, one paste, one page reload.

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 needWhyWhere it comes from
A Lessly productTracking data belongs to a productCreate and manage products
Tracking added to that productIt puts a Tracking entry in the product sidebarA platform step, outside Tracking itself
Access to the productEvery Tracking page sits behind the product loginGive someone access to a product
A website whose HTML you can editThe snippet goes in the <head> of every page you trackYour 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), an API key (only for events from your backend), 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 TrackingInstall. 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 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:

WhereWhat to do
Plain HTML (Recommended)Paste it just before the closing </head> of the template that renders every page.
WebflowProject SettingsCustom CodeHead Code, then publish.
WordPressA header-snippet plugin (WPCode, Insert Headers and Footers), or your theme’s header.php. Prefer the plugin — the snippet then survives theme updates.
FramerSite SettingsGeneralCustom CodeStart of <head> tag, then publish.
Google Tag ManagerA 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.

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:

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:

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

Next steps

Was this page helpful?
Esc

Start typing to search the docs.

navigateselect