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_startedevent with session IDs to GA4 - Utility functions — Cookie handling for reliable ID capture