Microsoft Clarity API guide
clarity.microsoft.com
Generate Microsoft Clarity tag snippets, check local HTML for masking attributes, and export recent project insights by dimension.
Actions and inputs
snippet installGenerate the HTML tag snippet for a project.
Inputs project ID
tag getFetch the tag script for a project.
Inputs project ID
audit htmlCheck a local HTML file for the tag, masking attributes, and client calls.
Inputs HTML file path
insights liveExport recent dashboard insights grouped by a dimension.
Inputs days, dimension
Clarity projects
- Create
Create a project for a website you administer without installing a tag or enabling data collection.
Inputs Project name, website URL
- Read
View an authorized project’s settings and aggregate dashboard metrics.
Inputs Project name or ID, dashboard date range
- Update
Rename a project you administer without changing data collection settings.
Inputs Project ID, new name
- Delete
Delete a project you administer only after reviewing Clarity’s data-loss warning and confirming removal.
Inputs Project ID, confirmation