Skip to main content
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:
  1. Tag the session with the widget ID so you can filter recordings.
  2. Fire custom events for key interactions so they appear alongside Clarity’s Smart Events.
  3. 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.

Custom tags

Tags are set via window.clarity("set", key, value) and appear in Clarity’s Filters panel.
TagValueDescription
molin_widget_idyour widget IDSet 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.
EventWhen it fires
molin_chat_openUser opens the chat window
molin_chat_closeUser closes the chat window
molin_message_sentUser sends a message in the chat
molin_link_clickUser 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).