Track your first visitor
Install the tracking snippet and confirm your first page view in the live feed.
Add the Tracking snippet to your site, load a page, and check that its page_view event arrived. This tutorial takes you through that first event. The events you collect can then support reports on traffic sources, attribution, and revenue.
What you need first
Every Tracking domain, event, person, and report belongs to the product you select.
You need | Why | Where it comes from |
|---|---|---|
A Lepsto product | Stores your Tracking data | |
Tracking added to the product | Adds Tracking to the product sidebar | Product setup on the platform |
Access to the product | Tracking pages require a product login | |
A website whose HTML you can edit | The snippet goes in the <head> of each page you track | Your site template, site builder, or tag manager |
List the hostnames you plan to track. You’ll add them to the Install checklist and confirm that each sends events. The examples use acme.com and its customer ada@acme.com; replace these with your site’s hostname and a test address you control.
You can start without a Google Ads account, a public access key, or a custom tracking host. The browser snippet needs no key and loads from public.lepsto.com by default. Add Google Ads when you need that integration, and create a public access key when your backend needs to send events.
1. Open the Install page
Open Tracking → Install in the product sidebar. Follow its two sections: add the snippet, then verify incoming events.
Tracking initially opens on Dashboard. Its other pages are Install, Live, People, Reports, Google Ads, Events, Public access, and Tracking domain.
2. Copy the snippet
Select Copy in the Loader snippet block. The snippet already contains your product’s script URL. Use the same snippet across the product’s domains and pages.
The loader queues calls to lt(…) while the script loads. The shorter Minimal variant, under advanced, is safe only when your code waits for the script to load before making those calls. Use the loader for this tutorial; install the tracking script explains both variants.
3. Paste it into the <head> of your site
Add the snippet to the <head> of every page you want to track. Put it near the top when editing HTML directly. The Where are you installing? section gives instructions for these options:
Where | What to do |
|---|---|
Plain HTML | Add the snippet to the shared page template. The install instructions place it before the closing </head>. |
Webflow | Open Project Settings → Custom Code → Head Code, add the snippet, and publish. |
WordPress | Use a header-snippet plugin such as WPCode or Insert Headers and Footers, or edit the theme’s header.php. A plugin preserves the snippet through theme updates. |
Framer | Open Site Settings → General → Custom Code → Start of <head> tag, add the snippet, and publish. |
Google Tag Manager | Create a Custom HTML tag with the All Pages trigger, then submit and publish the container. |
Google Tag Manager loads before it fires the Tracking tag, which can miss the earliest page views. Place the snippet directly in <head> when possible.
Load the snippet on every visit, including before a consent decision. If the page uses the Lepsto consent banner, put its tag above the tracking snippet, without async or defer, and declare data-consent="banner" on the tracking script. When requesting a snippet through tracking_snippets_get, set consentBanner: true for those pages. The installation guide shows how to add the declaration.
A recorded decision takes precedence. With the declaration and no decision yet, the tracker starts cookieless even if the banner has not loaded; accepting statistics consent switches to full mode. Do not add this declaration on pages without the Lepsto banner. Loading the tracker only after acceptance hides declining and undecided visitors from event counts. Follow the consent setup instructions.
Deploy or publish the page change. Visitors must receive the updated HTML for tracking to run.
4. Load a page
Open a published page of your site in a browser. The snippet sends a page_view automatically.
5. Watch it arrive
Return to Install → Verify your install. Enter the hostname you loaded, such as acme.com, and select Add. It appears under Registered domains.
The checklist refreshes every 10 seconds. When an event arrives from that hostname, its row changes from Waiting for events to Script seen and shows the last-seen time. That status covers events received within the last 30 days.
- Register the exact hostname.
acme.comandwww.acme.comare separate entries becausewwwis preserved. - Check
Also sending eventsif you don’t see the expected match. It lists unregistered hostnames that sent events; selectAdd to checklistto register one. This can reveal a typo or a missing subdomain.
Open Live to see individual events, their pages, sources, and visitors. It refreshes every 5 seconds and displays Your first event just landed when the first event arrives.
Verify the install: your hostname should read Script seen, and Live should contain the page_view from the page you opened. If either is missing, follow tracking troubleshooting.
Record something of your own
After the snippet, call its global lt function where your application completes an action:
lt('track', 'signup_completed', { plan: 'pro' });Replace signup_completed and the example plan with the event and properties your application uses. The arguments are the command, a free-form event name, and an optional properties object. Check for the name in Live and in the Events catalog.
Put a name to the visitor
The script does not read forms or identify visitors automatically. Call identify when your application learns the visitor’s own email address, such as after sign-up, sign-in, or a signed-in page load:
lt('identify', 'ada@acme.com', { plan: 'pro' });In full tracking mode, this connects the visitor to a known person on People, including their earlier browsing. Cookieless mode drops identify calls. Identify a visitor explains the accepted identifiers and consent behavior.
Next steps
- Install the tracking script: compare snippets, automatic collection, and delivery.
- Record your own events: choose names and properties and inspect incoming events.
- Send revenue from your backend: record lifecycle events and customer revenue.
- Read the attribution reports: inspect which sources brought customers.
- Trigger a workflow from a tracked event: use an event to start a workflow.
- Fix an install that sends nothing: check collection failures.