Docs

Auto-Capture

One script tag captures UI interactions automatically — clicks, navigations, form submissions, and page views — with no further code changes. Perfect for session context around your manually tracked events.

Setup

Add the script to your HTML <head> and initialize it with your public key (safe to expose — it can only submit events, never read data):

index.htmlstl_capture.js
<script src="https://cdn.softechlog.com/capture@1.0/stl_capture.js"></script>
<script>
  Softechlog.init("stl_pk_xxxxxxxxxxxx");
</script>

Identify the current user

Call once on login or page load when the user is known. Until then, events are attributed to an anonymous visitor:

app.jsafter login
Softechlog.identify({
  id: currentUser.id,       // required
  name: currentUser.name,   // optional
  email: currentUser.email, // optional
});

What gets auto-captured

TriggerAction nameCaptured data
Button clickui.button_clickedtext, selector, page_url
Link clickui.link_clickedtext, href, page_url
Form submitui.form_submittedform name/id, page_url
Page viewui.page_viewedurl, title, referrer
Auto-capture never reads form field values — only structural metadata like form names and page URLs. Sensitive input content stays in the browser.

Sessions

Auto-captured events are grouped into browsing sessions automatically. Each session records its starting page, duration, and event count — browse them in the dashboard under Sessions, and drill into a session to replay the event timeline.

Manual tracking from the browser

For meaningful actions outside the auto-capture scope, you can also track custom events with the same script:

app.jscustom event
Softechlog.track("custom.event", { extra: "metadata" });

Events sent from the browser are marked capture_mode: auto, so you can always separate them from server-tracked events when filtering.