Integrate Clarity with GA4

Connect session recording IDs to your analytics data. Find the recordings that explain metric changes.

Download GTM Container

What This Integration Does

This GTM container sends Clarity's session ID and user ID to Google Analytics 4 as event parameters. This lets you:

  • Find specific recordings — Search GA4 for a segment, get the Clarity session IDs, watch those exact recordings
  • Connect metrics to evidence — When conversion drops, find the recordings that show why
  • Build audiences — Create GA4 audiences based on behavior, then watch their sessions in Clarity

What's Included

The GTM container includes:

  • Microsoft Clarity tag — Installs Clarity on all pages
  • Session ID capture — Extracts Clarity's session and user IDs from cookies
  • GA4 event — Sends clarity_session_started event with session IDs to GA4
  • Utility functions — Cookie handling for reliable ID capture

Setup Instructions

Prerequisites

  • Google Tag Manager container on your site
  • Microsoft Clarity account (create free account)
  • GA4 property with Measurement ID