Docs / Setup
Install the tracking script
Add one script tag to your site to start tracking visits, verify the install, and keep your own traffic and bots out of the data.
Reflects product behavior as of August 2026.
The VisiLead tracker is a single script tag. It loads deferred, never blocks rendering, and sends events with navigator.sendBeacon, falling back to fetch with keepalive when a browser needs it.
Each event captures the page URL, path and title, the referrer, UTM source, medium and campaign, the device type (desktop, tablet or mobile), a session id, an anonymous visitor id, and timestamps. Time on page, scroll depth and an engagement score are computed from a page-exit event, so engagement data arrives when the visitor leaves the page.
Sessions close after 30 minutes of inactivity, and the anonymous visitor id persists in localStorage, so returning visitors are recognized across sessions.
Before you start
- A VisiLead account
- Your tracking ID from Dashboard > Settings > Tracking
- Access to edit the HTML or shared layout of your site
- 1
Copy your tracking ID
Open Dashboard > Settings > Tracking and copy your tracking ID. It looks like vl_ followed by 12 hex characters.
- 2
Add the snippet to every page
Paste the snippet into a layout or template that renders on every page of your site, then replace YOUR_TRACKING_ID with your own id. The script loads deferred, so it does not block rendering.
<script src="https://visilead.co/tracker.js" data-id="YOUR_TRACKING_ID" defer></script> - 3
Set the attributes you need
The script supports exactly two attributes: data-id, which is required, and data-consent, whose only accepted value is "manual". Leave data-consent off to start tracking on page load, or set data-consent="manual" to hold all tracking until your cookie banner grants consent. See the consent and privacy guide for the full flow.
- 4
Exclude your own traffic
Open Settings > Tracking > Excluded IPs and add your office IP addresses. Use the "add my current IP" helper to add the network you are on right now. Bots are already filtered for you: about 50 headless and automation browser signatures are blocked client-side, the server filters about 45 more bot user agents, and requests without a user agent are treated as bots.
- 5
Verify the install
Open Dashboard > Settings > Tracking and click Verify. The server fetches your homepage HTML and looks for the script tag with your tracking id.
- 6
Confirm data is flowing
Visit a few pages on your site from a network that is not excluded, then check the dashboard. Data flowing into the dashboard is the definitive proof that the install works.
Tag manager installs can fail verification
The Verify check reads your homepage's raw HTML only. An install injected at runtime by a tag manager can be working correctly and still fail the automated check. If events show up in your dashboard, the install is working.
Single page app support
The tracker works with pushState-based routers such as Next.js and React Router. Navigations that only call history.replaceState are not counted as page views.
Frequently asked questions
How do I implement a company-level tracking script on my pricing page?+
Install the standard VisiLead snippet site-wide; one script covers every page, including your pricing page. Once it is live, VisiLead identifies the companies behind your traffic, and you can add a /pricing* conversion goal or alert rule on top of the same install.
Does the VisiLead tracking script slow down my website?+
No. The script loads with the defer attribute so it never blocks rendering, and it sends events with navigator.sendBeacon, falling back to fetch with keepalive.
Does VisiLead work with Next.js and other single page apps?+
Yes. The tracker supports pushState-based routers such as Next.js and React Router. The one limitation is that navigations performed only with history.replaceState are not counted as page views.
What data does the tracking script capture?+
Each event captures the page URL, path and title, the referrer, UTM source, medium and campaign, the device type, a session id, an anonymous visitor id, and timestamps. Time on page, scroll depth and an engagement score are computed from a page-exit event.
Why does verification fail when I installed through a tag manager?+
The automated check reads your homepage's raw HTML, so a script injected at runtime by a tag manager can work correctly yet fail the check. Data flowing into the dashboard is the definitive proof of a working install.
How does VisiLead filter bot traffic?+
Bots are filtered on both sides: about 50 headless and automation browser signatures are blocked in the browser, the server filters about 45 more bot user agents, and requests without a user agent are treated as bots. You can also exclude your own office IPs under Settings > Tracking > Excluded IPs.
How long does a VisiLead session last?+
A session ends after 30 minutes of inactivity. The anonymous visitor id persists in localStorage, so a returning visitor starts a new session under the same visitor id.
Related
Two minutes from script to first identified company
Install the tracking script, connect your CRM, and see which channels drive revenue. Free plan, no credit card.