Install logcohort
logcohort records sessions through one script tag. The snippet defines a tiny command queue (window.logcohort) and loads the recorder asynchronously — it never blocks your page. Your project key lives in the dashboard: Project → Install, where the snippet is generated with the key already filled in.
<script>
window.logcohort||(function(d){
var o=window.logcohort=function(){o.api.push(arguments)};o.api=[];
var c=d.createElement('script');c.async=true;
c.src='https://app.logcohort.com/recorder.js';
d.getElementsByTagName('head')[0].appendChild(c);
})(document);
logcohort('init','lc_YOUR_PROJECT_KEY');
</script>Pick your platform
- Any website (plain HTML) — paste before
</head>. - Next.js — inline script in the root layout (and why not
next/script). - Google Tag Manager — no code change, no deploy.
Verify it works
- Publish the change (or just open your site locally if the origin is allowed).
- Visit your site and click around for a few seconds.
- Open the logcohort dashboard — the session appears within seconds.
Privacy defaults: everything visitors type is masked in their browser before transmission, and network capture records method/URL/status/duration only — never request or response bodies. Ingest also checks your project's origin allowlist, so a leaked key can't record from an unknown site.
Next step: identify signed-in users so sessions show a name instead of an anonymous visitor id.