If you use Microsoft Clarity on your website, the Molin AI widget automatically sends custom tags and events to Clarity. This lets you filter session recordings and heatmaps by Molin AI interactions, with zero configuration.
How it works
When a visitor interacts with the widget, we call the Clarity client API (window.clarity(...)) to:
- Tag the session with the widget ID so you can filter recordings.
- Fire custom events for key interactions so they appear alongside Clarity’s Smart Events.
- Upgrade the session to prioritize it for recording when a user opens the chat.
If Clarity is not installed on your website, these calls are silently skipped. There is no performance impact and no errors.
Tags are set via window.clarity("set", key, value) and appear in Clarity’s Filters panel.
| Tag | Value | Description |
|---|
molin_widget_id | your widget ID | Set once per page load so you can filter by widget |
Custom events
Events are fired via window.clarity("event", name) and appear in the Smart Events section.
| Event | When it fires |
|---|
molin_chat_open | User opens the chat window |
molin_chat_close | User closes the chat window |
molin_message_sent | User sends a message in the chat |
molin_link_click | User clicks a link inside the chat conversation |
Session upgrade
When a user opens the chat, we call window.clarity("upgrade", "molin_chat_open"). This tells Clarity to prioritize recording this session, which is useful if your site exceeds Clarity’s daily recording limit and sampling kicks in. Sessions where users interacted with the AI are high-value and worth preserving.
Requirements
Microsoft Clarity must already be installed on your website (the Clarity <script> tag in your page).