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(w,d){
var o=w.logcohort=function(){o.api.push(arguments)};o.api=[];o._v='1';
o._w={fetch:w.fetch};
w.fetch&&(w.fetch=function(){return o._w.fetch.apply(this,arguments)});
var c=d.createElement('script');c.async=true;c.type='text/javascript';
c.src='https://app.logcohort.com/recorder.js';
c.onerror=function(){w.console&&w.console.warn&&w.console.warn('[logcohort] recorder failed to load from '+c.src)};
d.getElementsByTagName('head')[0].appendChild(c);
})(window,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.
- Shopify — paste into
theme.liquid, no app needed.
Hybrid mobile apps (Capacitor, React Native WebView)
If your mobile app renders web pages — a Capacitor/Ionic app, or web screens inside a React Native WebView — those pages record with the same snippet, no extra setup: an in-app webview is a real browser engine, so install the snippet on the pages it loads and they replay like any other session. Fully native screens (Swift/Kotlin/React Native components) are not web pages and are not recorded.
One project per site
Give each site its own project and its own key — the marketing site one project, the app another. Reusing a single key to see everything in one list is tempting, but it mixes both sites' page metrics into one pool, forces them to share one privacy and origin configuration, and can't be untangled later. You lose nothing by keeping them apart: Journeys already follows one person across your projects — sessions join automatically across your subdomains, and across separate domains when both sites identify the same signed-in user.
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. To hide displayed text or whole regions too, see Privacy & masking.
Next step: identify signed-in users so sessions show a name instead of an anonymous visitor id.