Skip to content

Commit 1d1a686

Browse files
authored
Dj rage clicks heatmap data docs (#2195)
* Rage clicks and dead clicks, making it clearer * One more tiny change
1 parent e124e1e commit 1d1a686

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

pages/docs/tracking-methods/sdks/javascript/javascript-replay.mdx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,28 +172,34 @@ mixpanel.get_session_replay_url();
172172
// https://mixpanel.com/projects/replay-redirect?replay_id=19307d78e24394fe15-0cd98d8fd9ad1d-1f525636-4b9600-19307d78e28194fe15&distinct_id=123&token=my-project-token
173173
```
174174

175-
## Heatmaps
175+
## Heatmaps, Rage Clicks, and Dead Clicks (Web Only)
176176

177-
To supplement your Session Replay data, enable [Heatmaps](/docs/session-replay/heatmaps) data collection. The current Heatmap functions as a click map, tracking user interactions with individual site elements.
177+
The `record_heatmap_data` option (Web only; not available on mobile) enables three types of interaction tracking during replay sessions:
178178

179-
Enable Heatmap data collection by setting `record_heatmap_data` to `true` during library initialization.
179+
1. **Click events** - Captures user clicks to populate click heatmaps
180+
2. **Rage clicks** - Captures multiple rapid clicks on the same element (`$mp_rage_click`)
181+
3. **Dead clicks** - Captures clicks on unresponsive elements (`$mp_dead_click`)
180182

181-
Ensure Session Replay is enabled, as Heatmaps only collect data during sessions with recorded replays. If a page has limited replay coverage, the resulting Heatmap may provide limited or less meaningful insights.
183+
These events are only captured when a session recording is in progress, and they are exempt from your plan data allowance.
182184

183-
Clicks recorded using `record_heatmap_data` will only capture clicks while an a session recording is in progress. These clicks are sent as `$mp_click` and will not be counted against your plan data allowance.
185+
**Important:** Session Replay must be enabled for `record_heatmap_data` to work. Heatmaps only collect data during sessions with recorded replays. If a page has limited replay coverage, the resulting Heatmap may provide limited or less meaningful insights.
184186

185187
**Example Usage**
186188

187189
```javascript Javascript
188190
mixpanel.init('YOUR_PROJECT_TOKEN', {
189191
record_sessions_percent: 1, // Session Replay must be enabled for Heatmap
190-
record_heatmap_data: true // Enable Heatmap data collection
192+
record_heatmap_data: true // Enable Heatmap, Rage Click, and Dead Click collection
191193
});
192194
```
193195

194-
If you use [Autocapture](/docs/tracking-methods/autocapture) to track clicks, you can leverage these clicks to populate the Heatmaps without setting the `record_heatmap_data` option during library initialization.
196+
<Callout type="info">
197+
Events generated by `record_heatmap_data` (clicks, rage clicks, dead clicks) are exempt from your plan data allowance.
198+
</Callout>
195199

196-
Clicks captured by Autocapture are billable events that are counted against your plan data allowance.
200+
### Alternative: Using Autocapture for Heatmaps
201+
202+
If you use [Autocapture](/docs/tracking-methods/autocapture) to track clicks, you can leverage these clicks to populate Heatmaps without enabling `record_heatmap_data`. Autocapture also supports rage and dead click detection.
197203

198204
**Example Usage**
199205

@@ -211,9 +217,7 @@ mixpanel.init('YOUR_PROJECT_TOKEN', {
211217
});
212218
```
213219

214-
<Callout type="info">
215-
Clicks generated by `record_heatmap_data` are exempt from your plan data allowance. Clicks generated by [Autocapture](/docs/tracking-methods/autocapture) are billable events.
216-
</Callout>
220+
Clicks captured by Autocapture are billable events that are counted against your plan data allowance.
217221

218222
## Debugging
219223

0 commit comments

Comments
 (0)