Install session replay with Google Tag Manager

The GTM route needs no code change and no deploy — if you can publish a container, you can start recording today.

  1. In GTM, create a new tag: Tag Configuration → Custom HTML.
  2. Paste the snippet below (your dashboard generates it with your key 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>
  1. Set the trigger to All Pages.
  2. Publish the container.
  3. Visit your site, click around, and open the logcohort dashboard — the session appears within seconds.

Trade-off to know: GTM itself loads asynchronously, so recording starts a moment later than a direct <head>install. For most sites this is invisible; if you want the earliest possible start, use the plain HTML install instead.

Next: identify signed-in users.