Documentation

Everything you need to integrate LeadFnF Analytics into any website in minutes.

Quickstart

Add this single script tag to the <head> of every page you want to track. That's all you need.

index.html — Step 1 of 1
<head>
  ...
  <script
    src="https://leadfnf.com/js/lf.js"
    data-site="YOUR_SITE_UUID"
    async></script>
</head>

Find your Site UUID in the Sites dashboard after adding your site. Copy it from the snippet page.

Enable Session Recording

Add data-record="true" to load rrweb and begin capturing session replays. Recordings are stored based on your plan's replay limit and retention period.

Session Recording enabled
<script
  src="https://leadfnf.com/js/lf.js"
  data-site="YOUR_SITE_UUID"
  data-record="true"
  async></script>

Custom Events — JavaScript API

Track any user action using window.lf.track(). Accepts an event name and an optional properties object.

No setup required. You don't pre-register events. The first time an event is received it appears automatically under Dashboard → Events. Tip: use the built-in Event builder there to generate a ready-to-paste snippet.

JavaScript
// Track a custom event with properties
window.lf.track('signup_completed', {
  plan: 'pro',
  source: 'landing_page',
  value: 49
});

// Track a simple event (no properties)
window.lf.track('newsletter_subscribed');

// Track a purchase
window.lf.track('purchase', {
  order_id: 'ord_abc123',
  revenue: 99.00,
  currency: 'USD'
});

Auto-capture via HTML Attributes

Track clicks on any element without writing JavaScript. Add data-lf-track to any HTML element.

HTML — Zero JavaScript required
<!-- Simple click tracking -->
<button data-lf-track="upgrade_clicked">
  Upgrade Plan
</button>

<!-- Track with link clicks -->
<a href="/checkout" data-lf-track="checkout_started">
  Checkout
</a>

Server-side API

Track backend events — purchases, signups, fulfilment steps — from your server using your API key. Find your API key in Settings → API Key.

Endpoint
POST /api/v1/event
Auth
X-API-Key: sk_live_...
cURL
curl -X POST https://leadfnf.com/api/v1/event \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "site_id": "YOUR_SITE_UUID",
    "event": "purchase",
    "properties": {
      "order_id": "ord_abc123",
      "value": 99,
      "currency": "USD"
    }
  }'
Want this event in a Funnel? Server-side events have no visitor session, so by default they count in Goals but not in session funnels. To tie the event to the visitor's on-site journey, include their session in the request:
  • In the browser, read sessionStorage.getItem('lf_session_' + YOUR_SITE_ID) and send it to your backend (e.g. a hidden form field).
  • Forward it as "session_uuid" in the POST body. The response returns "session_matched": true when it linked successfully.
Response
{"ok": true, "session_matched": true}

User Identification

Associate a session with a known user after login. Useful for connecting analytics to your user database.

JavaScript — call after login
window.lf.identify('user_12345', {
  email: '[email protected]',
  plan: 'pro',
  created_at: '2025-01-15'
});

GDPR & consent — read before using identify

Everything you pass to identify() — user IDs, email addresses, custom traits — is personal data under GDPR. Unlike LeadFnF's anonymous tracking, this data can identify a person, so different rules apply:

  • You are the data controller for identified data; LeadFnF acts as your processor. Disclose this in your own privacy policy.
  • Establish a legal basis first. Typically the user's consent or your contract with them (e.g. terms accepted at signup). Only call identify() for authenticated users covered by that basis — never for anonymous visitors.
  • Document it. Record when and how the user agreed, and cover analytics processing in your terms or consent flow.
  • Minimize. Pass an internal user ID instead of an email address where possible — it is just as useful for connecting sessions to your database.
  • Deletion requests: identified data is removed when you delete the site or your account; contact support for individual-user erasure to honor Article 17 requests.

Identified attributes are never sent to third-party AI services. See our Privacy Policy for the full sub-processor list.

Privacy & GDPR

LeadFnF is designed to work without cookies and without requiring a consent banner in most jurisdictions.

Do Not Track respected
The script checks navigator.doNotTrack automatically. If it's set to "1", no data is collected for that visitor.
No third-party cookies
Session tracking uses sessionStorage — a tab-scoped browser storage that's cleared automatically when the tab closes. Zero cookie writes.
IP anonymization
IP addresses are used only to determine country/city. The last octet is zeroed before storage. You can disable geo tracking entirely in site settings.
Automatic data expiry
Session recordings and event data are automatically purged after your plan's retention period (7 days on Starter, 30 on Pro, 90 on Business).
Password & sensitive input masking
Session replay never records input[type=password], credit card fields, or any element with the class lf-mask or data-lf-mask attribute.

Ready to start tracking?

Create your account and start your 14-day free trial.

Get started free