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.
<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.
<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.
// 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.
<!-- 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.
POST /api/v1/event
X-API-Key: sk_live_...
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" } }'
- 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": truewhen it linked successfully.
{"ok": true, "session_matched": true}
User Identification
Associate a session with a known user after login. Useful for connecting analytics to your user database.
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.