# Microsoft Clarity setup for PopMCP

You end up pasting one Clarity Data Export API token, a JWT generated by a project Admin under Settings and Data Export.

- Auth: API credentials
- Setup time: 3 min
- API base URL: https://www.clarity.ms/export-data/api/v1
- Credentials screen: https://clarity.microsoft.com/projects
- Provider docs: https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-data-export-api

## Before you begin

- A Microsoft Clarity project with the tracking code installed and collecting sessions
- The Admin role on that project. Team members cannot manage API tokens.
- The project you want to export open in Clarity. Tokens only return data for the project they were created in.

## Get your credentials

### 1. Open the project you want to export

Sign in at clarity.microsoft.com and open the project from My Projects. Check that your role on it is Admin.

Screen: https://clarity.microsoft.com/projects

### 2. Go to Settings and Data Export

In the project, open Settings and select the Data Export tab. Click Generate new API token.

### 3. Name the token

Type a name of 4 to 32 characters using letters, numbers, hyphens, underscores and periods. Spaces and characters such as `@ # $ % & * !` are rejected.

### 4. Copy the token

Copy the JWT from the dialog and store it somewhere safe before closing.

### 5. Paste the token into PopMCP

Paste the value into PopMCP's API token field and click Save.

## Fields PopMCP asks for

- API token (token) [required]: In Clarity, open Settings → Data Export → Generate new API token (project admins only), give it a name, and copy the token. Paste it here. It's stored encrypted. Heads up: Clarity allows only 10 API requests per project per day.

## Verify

The Clarity connector in PopMCP shows Connected, and asking for traffic or popular pages for the last day returns real session counts instead of a 401.

## Troubleshooting

### 401 Unauthorized

Cause: Token missing, mistyped, expired, or deleted from the Data Export screen.

Fix: Generate a new token under Settings and Data Export, then paste the full JWT. It is long, so check nothing was cut off.

### 403 Forbidden

Cause: The token is not authorised for the operation, usually because the user who created it was removed from the project.

Fix: Have a current project Admin delete the old token and generate a replacement. Microsoft recommends replacing tokens whenever a user loses project access.

### 429 Exceeded daily limit

Cause: More than 10 API requests were made against this project in one day.

Fix: Wait for the daily quota to reset and keep Clarity queries to a small number of broad requests.

### The Data Export tab is not visible

Cause: Your role on the project is Team member rather than Admin.

Fix: Ask a project Admin to generate the token, or have them change your role under Settings and Team.

### Fewer rows than expected

Cause: Responses are capped at 1,000 rows and cannot be paginated.

Fix: Narrow the request with dimensions rather than asking for one broad export. A single call accepts at most three dimensions.

---

Source: https://www.docs.popmcp.com/docs/integrations/microsoft-clarity/