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.
- In GTM, create a new tag: Tag Configuration → Custom HTML.
- 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>- Set the trigger to All Pages.
- Publish the container.
- 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.