# pub.chive.metrics.recordDwellTime

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.metrics.recordDwellTime)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.metrics.recordDwellTime/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.metrics.recordDwellTime/examples)

## Definitions

### `pub.chive.metrics.recordDwellTime`

**Type**: `procedure`

Record dwell time for a clicked search result (called via beacon API)

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | AT-URI of the viewed eprint |
| `dwellTimeMs` | `integer` | Yes | Time spent on the page in milliseconds |
| `impressionId` | `string` | Yes | UUID of the search impression |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `success` | `boolean` | Yes | Whether the dwell time was recorded |

#### Errors

- **InvalidRequest**

## Raw Schema

```json
{
  "id": "pub.chive.metrics.recordDwellTime",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "impressionId",
            "uri",
            "dwellTimeMs"
          ],
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the viewed eprint"
            },
            "dwellTimeMs": {
              "type": "integer",
              "minimum": 0,
              "description": "Time spent on the page in milliseconds"
            },
            "impressionId": {
              "type": "string",
              "description": "UUID of the search impression"
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "InvalidRequest"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "success"
          ],
          "properties": {
            "success": {
              "type": "boolean",
              "description": "Whether the dwell time was recorded"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Record dwell time for a clicked search result (called via beacon API)"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
