Install session replay on Shopify

Shopify needs no app — the snippet goes straight into your theme:

  1. In Shopify admin, open Online Store → Themes.
  2. On your current theme, click … → Edit code.
  3. Open layout/theme.liquid.
  4. Paste the snippet just before the closing </head> tag:
<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>
  1. Replace lc_YOUR_PROJECT_KEY with your project key — the logcohort dashboard (Project → Install) generates the block with the key already filled in.
  2. Save. Recording starts with the next visit.

Already running Google Tag Manager on your store? The GTM install works on Shopify too.

What gets recorded

Every storefront page the theme renders: home, collections, product pages, cart, search — with the console and network log on the replay timeline, and rage/dead/error clicks flagged. Everything shoppers type is masked in their browser before transmission.

Honest limit — checkout: Shopify's checkout runs on Shopify's own pages, which don't load theme scripts. Sessions record up to the moment the shopper enters checkout and the replay shows the exit to it; the checkout steps themselves aren't recorded. Every tool installed via theme snippet shares this limit.

Verify

Open your storefront in a new tab, click around for a few seconds, then open the logcohort dashboard — the session appears within seconds.

Next: identify signed-in customers.