Quick Start
Send your first log in under 2 minutes, from any device or language.
Step-by-step
1
Create your account
Go to the
Pricing page, pick Free or a paid plan, and sign up. Takes 30 seconds.
2
Generate an API key
On the
Account page, click
Generate New Key. Copy it — you won't see the full key again.
3
Install the SDK for your platform
Pick your language below. If yours isn't listed, use the
REST API directly — it works everywhere.
4
Send a test event
Call
ll.log() with an action and user ID. Open your
Dashboard — your event appears in the Live Feed within 1 second.
5
Log every user action
Add a log call at every key moment: app open, search, product view, add to cart, checkout, purchase. The funnel builds itself automatically.
Minimal example
Python
Node.js
Swift
Kotlin
cURL
click to copypip install loglogic-sdk
# In your app
from loglogic import LogLogic
ll = LogLogic("ll_your_api_key_here")
ll.log({
"action": "purchase",
"user_id": "usr_12345",
"funnel": "checkout",
"data": {"amount": 49.99}
})
click to copynpm install @loglogic/sdk
// In your app
const { LogLogic } = require('@loglogic/sdk');
const ll = new LogLogic('ll_your_api_key_here');
await ll.log({
action: 'purchase',
user_id: 'usr_12345',
funnel: 'checkout',
data: { amount: 49.99 }
});
click to copy// Swift Package Manager
// Add to Package.swift dependencies:
// .package(url: "https://github.com/loglogic/swift-sdk", from: "1.0.0")
import LogLogic
let ll = LogLogic(apiKey: "ll_your_api_key_here")
ll.log(action: "purchase", userId: "usr_12345", funnel: "checkout",
data: ["amount": 49.99])
click to copy// build.gradle.kts
implementation("io.loglogic:android-sdk:1.0.0")
// In your Activity / Application class
val ll = LogLogic("ll_your_api_key_here")
ll.log(
action = "purchase",
userId = "usr_12345",
funnel = "checkout",
data = mapOf("amount" to 49.99)
)
click to copycurl -X POST https://api.loglogic.io/ingest \
-H "Authorization: Bearer ll_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"action":"purchase","user_id":"usr_12345","funnel":"checkout","data":{"amount":49.99}}'
Core Concepts
Understanding how LogLogic models your data.
Events
Everything in LogLogic is an event. An event represents one user action at one point in time. Each event has four fields:
click to copy{
"action": "add_to_cart", // what happened (required)
"user_id": "usr_12345", // who did it (required)
"funnel": "checkout", // which flow (optional)
"data": { "sku": "SHOE-42" } // any extra JSON (optional)
}
Funnels
A funnel is a named sequence of actions. LogLogic automatically groups events by funnel and calculates step-by-step completion, churn, and conversion rates. You don't need to configure anything — just include a funnel field in your events.
Common funnel names: checkout, onboarding, cart, app, navigation, support.
User IDs
Use whatever ID your app already has — a UUID, an email hash, a database ID. LogLogic never sees PII unless you explicitly send it in the data field.
Log retention
How long your events are stored depends on your plan. Free keeps 24 hours, Community keeps 7 days, Supporter keeps 30 days, and Brother keeps forever. Raw events older than your retention window are purged; aggregated metrics (totals, cohort rates) are kept indefinitely on paid plans.
Authentication
Every request needs a Bearer token. Here's how to handle it safely.
Your API key
API keys start with ll_ and are 51 characters long. Generate one on the Account page. Keys are shown once — copy it immediately and store it in your environment, not in your code.
⚠ Never commit your API key to Git or paste it in client-side JavaScript that ships to end users. Use environment variables or a secrets manager.
Using environment variables
click to copy# .env (never commit this file)
LOGLOGIC_API_KEY=ll_your_key_here
# Python
import os
ll = LogLogic(os.environ['LOGLOGIC_API_KEY'])
# Node.js
const ll = new LogLogic(process.env.LOGLOGIC_API_KEY);
# iOS — use Xcode .xcconfig or Secrets.plist, never Info.plist
# Android — use BuildConfig or local.properties
Rotating a key
If a key is compromised, go to Account → delete the old key → generate a new one. The old key stops working instantly. Update your environment variable and redeploy.
Swift SDK
For iOS, macOS, watchOS, and tvOS apps.
Installation
Swift Package Manager (recommended)
click to copy// Package.swift
dependencies: [
.package(url: "https://github.com/loglogic/swift-sdk", from: "1.0.0")
],
targets: [
.target(name: "YourApp", dependencies: ["LogLogic"])
]
Or in Xcode: File → Add Package Dependencies → paste https://github.com/loglogic/swift-sdk
Setup
click to copy// AppDelegate.swift or @main App
import LogLogic
// Initialize once at app startup
LogLogic.configure(apiKey: "ll_your_api_key_here")
// Or use the shared instance directly
let ll = LogLogic.shared
Logging events
click to copy// Basic event
LogLogic.shared.log(
action: "app_open",
userId: AuthManager.currentUserId
)
// With funnel and data
LogLogic.shared.log(
action: "purchase",
userId: AuthManager.currentUserId,
funnel: "checkout",
data: [
"amount": cart.total,
"currency": "USD",
"items": cart.items.count
]
)
// SwiftUI — log on appear
.onAppear {
LogLogic.shared.log(action: "view_product", userId: userId, funnel: "checkout")
}
Session tracking
click to copy// Automatic session IDs — enabled by default
LogLogic.configure(
apiKey: "ll_your_key",
autoSessionId: true, // attach session_id to every event
batchInterval: 2.0, // flush every 2 seconds (saves battery)
debugLogging: false // set true during development
)
Kotlin SDK
For Android apps. Supports Java interop.
Installation
click to copy// app/build.gradle.kts
dependencies {
implementation("io.loglogic:android-sdk:1.0.0")
}
// Add to AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
Setup
click to copy// Application.kt
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
LogLogic.init(
context = this,
apiKey = BuildConfig.LOGLOGIC_API_KEY // from local.properties
)
}
}
Logging events
click to copy// From any Activity, Fragment, or ViewModel
LogLogic.log(
action = "add_to_cart",
userId = viewModel.currentUserId,
funnel = "checkout",
data = mapOf("sku" to product.sku, "price" to product.price)
)
// With coroutines
lifecycleScope.launch {
LogLogic.logAsync("purchase", userId, "checkout", mapOf("amount" to total))
}
Keep keys out of your repo
click to copy# local.properties (git-ignored)
LOGLOGIC_API_KEY=ll_your_key_here
# build.gradle.kts — expose as BuildConfig field
android {
defaultConfig {
buildConfigField("String", "LOGLOGIC_API_KEY",
"\"${properties["LOGLOGIC_API_KEY"]}\"")
}
}
Flutter / Dart SDK
One package for iOS, Android, and Web Flutter apps.
Installation
click to copy# pubspec.yaml
dependencies:
loglogic: ^1.0.0
# Then
flutter pub get
Setup & usage
click to copyimport 'package:loglogic/loglogic.dart';
void main() {
LogLogic.init(apiKey: 'll_your_api_key_here');
runApp(MyApp());
}
// In your widgets
LogLogic.instance.log(
action: 'view_product',
userId: userId,
funnel: 'product',
data: {'product_id': product.id, 'price': product.price},
);
Python SDK
For backends, scripts, data pipelines, and server-side apps.
Installation
click to copypip install loglogic-sdk
Basic usage
click to copyimport os
from loglogic import LogLogic
ll = LogLogic(os.environ['LOGLOGIC_API_KEY'])
# Log a single event
ll.log({
'action': 'purchase',
'user_id': 'usr_12345',
'funnel': 'checkout',
'data': {'amount': 49.99, 'currency': 'USD'}
})
# Batch log (more efficient for pipelines)
ll.log_batch([
{'action': 'app_open', 'user_id': 'usr_1', 'funnel': 'app'},
{'action': 'view_product','user_id': 'usr_2', 'funnel': 'product'},
])
Django / Flask middleware
click to copy# Django — in your view
from loglogic import LogLogic
ll = LogLogic(settings.LOGLOGIC_KEY)
def purchase_view(request):
# ... handle purchase ...
ll.log({
'action': 'purchase',
'user_id': str(request.user.id),
'funnel': 'checkout',
'data': {'amount': order.total}
})
return JsonResponse({'ok': True})
Node.js / TypeScript SDK
For Express, Fastify, Next.js API routes, and any Node backend.
Installation
click to copynpm install @loglogic/sdk
# or
yarn add @loglogic/sdk
Usage (TypeScript)
click to copyimport { LogLogic } from '@loglogic/sdk';
// Initialize once (singleton pattern)
const ll = new LogLogic(process.env.LOGLOGIC_API_KEY!);
// Log an event
await ll.log({
action: 'purchase',
user_id: user.id,
funnel: 'checkout',
data: { amount: order.total, currency: 'USD' }
});
// Next.js API route example
export async function POST(req: Request) {
const { userId, amount } = await req.json();
await ll.log({ action: 'purchase', user_id: userId, funnel: 'checkout', data: { amount } });
return Response.json({ ok: true });
}
Go SDK
Lightweight, zero-dependency client for Go backends and microservices.
Installation
click to copygo get github.com/loglogic/go-sdk
Usage
click to copypackage main
import (
"os"
"github.com/loglogic/go-sdk"
)
func main() {
ll := loglogic.New(os.Getenv("LOGLOGIC_API_KEY"))
ll.Log(loglogic.Event{
Action: "purchase",
UserID: "usr_12345",
Funnel: "checkout",
Data: map[string]any{"amount": 49.99},
})
}
React / Next.js
Log from React components and Next.js pages. Always use server-side for sensitive keys.
⚠ Never use your API key in client-side React code — it will be visible to all users. Use Next.js API routes or a backend proxy to send logs server-side.
Next.js API route (recommended)
click to copy// app/api/log/route.ts
import { LogLogic } from '@loglogic/sdk';
const ll = new LogLogic(process.env.LOGLOGIC_API_KEY!); // server only
export async function POST(req: Request) {
const body = await req.json();
await ll.log(body);
return Response.json({ ok: true });
}
// Client component — calls your API route, not LogLogic directly
async function track(action: string, userId: string, funnel: string) {
await fetch('/api/log', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action, user_id: userId, funnel })
});
}
REST API / cURL
Direct HTTP — works from any language, shell script, or tool.
Ingest endpoint
click to copyPOST https://api.loglogic.io/ingest
Authorization: Bearer ll_your_api_key
Content-Type: application/json
Single event
click to copycurl -X POST https://api.loglogic.io/ingest \
-H "Authorization: Bearer ll_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"action":"purchase","user_id":"usr_12345","funnel":"checkout","data":{"amount":49.99}}'
Batch (up to 100 events)
click to copycurl -X POST https://api.loglogic.io/ingest/batch \
-H "Authorization: Bearer ll_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"events":[
{"action":"app_open","user_id":"usr_1","funnel":"app"},
{"action":"search","user_id":"usr_1","funnel":"navigation"},
{"action":"purchase","user_id":"usr_2","funnel":"checkout","data":{"amount":29.99}}
]}'
Response
// Success
{ "ok": true, "ingested": 1, "event_id": "evt_abc123" }
// Error
{ "ok": false, "error": "invalid_key", "message": "API key not recognized" }
Funnels
LogLogic builds your conversion funnel automatically from your events.
How it works
Every event with a funnel field is grouped into that funnel. LogLogic orders the unique actions by first occurrence across all users, then calculates how many users reached each step.
You don't need to define the funnel upfront. Just log events consistently and the dashboard shows you the full picture.
Example: e-commerce funnel
click to copy# Log these events in order as users move through your app
# All using funnel: "checkout"
{ "action": "app_open", "funnel": "checkout", "user_id": uid }
{ "action": "view_product", "funnel": "checkout", "user_id": uid }
{ "action": "add_to_cart", "funnel": "checkout", "user_id": uid }
{ "action": "enter_payment", "funnel": "checkout", "user_id": uid }
{ "action": "purchase", "funnel": "checkout", "user_id": uid }
LogLogic calculates completion %, churn rate, and overall conversion for each step. Red cells in the dashboard show your biggest drop-off points so you know exactly where to focus.
Webhooks
Get notified instantly when churn spikes or revenue drops. Available on Supporter and Brother plans.
Setting up a webhook
Go to Account → Webhooks → Add Endpoint. Enter any HTTPS URL that can accept POST requests. LogLogic will send a JSON payload when a trigger fires.
Payload format
click to copy{
"event": "churn_spike",
"triggered_at": "2025-06-01T13:41:02Z",
"funnel": "checkout",
"step": "view_cart",
"churn_pct": 62.1,
"threshold": 40.0
}
Slack example
click to copy# Point your webhook URL at a Slack Incoming Webhook
# LogLogic will POST the payload — Slack displays it automatically
# Or transform it with a tiny server:
app.post('/loglogic-webhook', (req, res) => {
const { event, funnel, step, churn_pct } = req.body;
slack.send(`🚨 Churn spike on *${step}* (${funnel}): ${churn_pct}%`);
res.json({ ok: true });
});
API Reference
Full endpoint list and field definitions.
Endpoints
POST /ingest — send a single event
POST /ingest/batch — send up to 100 events
GET /events — query stored events
GET /funnel — get funnel metrics
GET /dau — daily active users (30d)
GET /revenue — daily revenue (30d)
GET /retention — cohort retention table
DELETE /events — delete all events (careful!)
Event fields
| Field | Type | Required | Notes |
action | string | Yes | What happened. Max 64 chars. |
user_id | string | Yes | Your app's user identifier. |
funnel | string | No | Groups events into a funnel. Max 32 chars. |
session_id | string | No | Groups events in one session. |
platform | string | No | iOS, Android, Web, etc. |
timestamp | ISO 8601 | No | Defaults to server time. |
data | object | No | Any JSON. Max 4KB. |
Rate limits
Rate limits match your plan's log/day limit, enforced per minute at 1/1440th of your daily limit. If you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header.