From f09d1d5b12db4b64638a5d47ab98cd75b3a6fe5d Mon Sep 17 00:00:00 2001 From: Daniel Graham Date: Fri, 20 Jun 2025 12:07:50 -0700 Subject: [PATCH 1/4] docs: frustration analytics docs --- .../browser_sdk/en/browser-sdk-2.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/content/collections/browser_sdk/en/browser-sdk-2.md b/content/collections/browser_sdk/en/browser-sdk-2.md index 6d8d27630..a00a1301e 100644 --- a/content/collections/browser_sdk/en/browser-sdk-2.md +++ b/content/collections/browser_sdk/en/browser-sdk-2.md @@ -216,6 +216,7 @@ Starting in SDK version 2.10.0, the Browser SDK can autocapture events when you - Form interactions - File downloads - Element interactions +- Frustration interactions - Network tracking @@ -228,6 +229,7 @@ Starting in SDK version 2.10.0, the Browser SDK can autocapture events when you | `config.autocapture.formInteractions` | Optional. `boolean` | Enables/disables form interaction tracking. If `true`, Amplitude tracks form start and form submit events. Event properties tracked includes: `[Amplitude] Form ID`, `[Amplitude] Form Name`, `[Amplitude] Form Destination`. Default value is `true`. See [Track form interactions](#track-form-interactions) for more information. | | `config.autocapture.fileDownloads` | Optional. `boolean` | Enables/disables file download tracking. If `true`, Amplitude tracks file download events otherwise. Event properties tracked includes: `[Amplitude] File Extension`, `[Amplitude] File Name`, `[Amplitude] Link ID`, `[Amplitude] Link Text`, `[Amplitude] Link URL`. Default value is `true`. See [Track file downloads](#track-file-downloads) for more information. | | `config.autocapture.elementInteractions` | Optional. `boolean` | Enables/disables element interaction tracking. If `true`, Amplitude tracks clicks and form field interactions. Default value is `false`. See [Track element interactions](#track-element-interactions) for more information and configuration options. | +| `config.autocapture.frustrationInteractions` | Optional. `boolean` | Enables/disables frustration interaction tracking. If `true`, Amplitude tracks dead clicks and rage clicks. Default value is `false`. See [Track frustration interactions](#track-frustration-interactions) for more information and configuration options. | | `config.autocapture.networkTracking` | Optional. `boolean` | Enables/disables network tracking. If `true`, Amplitude tracks failed network requests. To configure what gets captured, set this as a network tracking options object. Default value is `false`. See [Track network interactions](#track-network-requests) for more information and configuration options. | {{/partial:collapse}} @@ -250,6 +252,7 @@ amplitude.init(AMPLITUDE_API_KEY, { formInteractions: false, fileDownloads: false, elementInteractions: false, + frustrationInteractions: false, }, }); @@ -646,6 +649,37 @@ These two events capture properties that describe the corresponding element and {{/partial:collapse}} +### Track frustration interactions + +You can enable frustration interaction tracking to capture dead clicks and rage clicks. Review our page on [Autocapture privacy and security](/docs/data/autocapture#privacy-and-security) for more information about the data collected with these events. + +Set `config.autocapture.frustrationInteractions` to `true` to enable dead click and rage click tracking (default `false`) + +```ts +amplitude.init(AMPLITUDE_API_KEY, { + autocapture: { + frustrationInteractions: true, //[tl! highlight] + }, +}); +``` + +#### Advanced configuration for frustration interactions + +Use the advanced configuration to control frustration interaction tracking. + +{{partial:collapse name="Tracking frustration interaction options"}} + +| Name | Value | Description | +| ------------------------------------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `config.autocapture.frustrationInteractions.deadClicks` | Optional. `boolean or object` | Enable dead click tracking (default `true`) | +| `config.autocapture.frustrationInteractions.deadClicks.cssSelectorAllowlist` | Optional. `(string)[]` | Accepts one or more CSS selectors that define which elements should have dead clicks tracked. By default, this is set to `[TODO: FILL ME IN WHEN READY]` | +| `config.autocapture.frustrationInteractions.rageClicks` | Optional. `boolean or object` | Enable rage click tracking (default `true`) | +| `config.autocapture.frustrationInteractions.rageClicks.cssSelectorAllowlist` | Optional. `(string)[]` | Accepts one or more CSS selectors that define which elements should have rage clicks tracked on. By default, this is set to `[TODO: FILL ME IN WHEN READY]` | +| `config.autocapture.frustrationInteractions.pageUrlAllowlist` | Optional. `(string\|RegExp)[]` | Defines the URL, URLs, or URL pattern on which Amplitude tracks element click and change events. By default, element interactions will be captured on any URL if undefined. | +| `config.autocapture.frustrationInteractions.dataAttributePrefix` | Optional. `(string\|RegExp)[]` | Allows the SDK to capture data attributes as an event property. By default, this is set to `data-amp-track`. | + +{{/partial:collapse}} + ### Track network requests Track when network requests fail (supports XHR and fetch). By default, tracks network requests with a response code in the range `500-599`, excluding requests made to any `amplitude.com` domain. From aa42f51ba811744b39578855b565f591ad707690 Mon Sep 17 00:00:00 2001 From: Daniel Graham Date: Fri, 20 Jun 2025 12:19:51 -0700 Subject: [PATCH 2/4] add event information --- .../browser_sdk/en/browser-sdk-2.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/content/collections/browser_sdk/en/browser-sdk-2.md b/content/collections/browser_sdk/en/browser-sdk-2.md index a00a1301e..4066a3cbb 100644 --- a/content/collections/browser_sdk/en/browser-sdk-2.md +++ b/content/collections/browser_sdk/en/browser-sdk-2.md @@ -680,6 +680,33 @@ Use the advanced configuration to control frustration interaction tracking. {{/partial:collapse}} + +{{partial:collapse name="Element interaction events"}} +When you enable frustration interactions for Autocapture, Amplitude sends two events + +- `[Amplitude] Dead Click` +- `[Amplitude] Rage Click` + +Dead click events capture the same properties as `[Amplitude] Element Clicked` plus: + + +- `[Amplitude] X` +- `[Amplitude] Y` + + +Rage click events capture the same properties as `[Amplitude] Element Clicked` plus: + + +- `'[Amplitude] Begin Time'` +- `'[Amplitude] End Time'` +- `'[Amplitude] Duration'` +- `'[Amplitude] Clicks'` +- `'[Amplitude] Click Count'` + + +{{/partial:collapse}} + + ### Track network requests Track when network requests fail (supports XHR and fetch). By default, tracks network requests with a response code in the range `500-599`, excluding requests made to any `amplitude.com` domain. From 75a8d375bfc40662aa2590f0b8d99603a1099397 Mon Sep 17 00:00:00 2001 From: Daniel Graham Date: Fri, 20 Jun 2025 12:27:53 -0700 Subject: [PATCH 3/4] again --- content/collections/browser_sdk/en/browser-sdk-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/collections/browser_sdk/en/browser-sdk-2.md b/content/collections/browser_sdk/en/browser-sdk-2.md index 4066a3cbb..de7ec5782 100644 --- a/content/collections/browser_sdk/en/browser-sdk-2.md +++ b/content/collections/browser_sdk/en/browser-sdk-2.md @@ -675,7 +675,7 @@ Use the advanced configuration to control frustration interaction tracking. | `config.autocapture.frustrationInteractions.deadClicks.cssSelectorAllowlist` | Optional. `(string)[]` | Accepts one or more CSS selectors that define which elements should have dead clicks tracked. By default, this is set to `[TODO: FILL ME IN WHEN READY]` | | `config.autocapture.frustrationInteractions.rageClicks` | Optional. `boolean or object` | Enable rage click tracking (default `true`) | | `config.autocapture.frustrationInteractions.rageClicks.cssSelectorAllowlist` | Optional. `(string)[]` | Accepts one or more CSS selectors that define which elements should have rage clicks tracked on. By default, this is set to `[TODO: FILL ME IN WHEN READY]` | -| `config.autocapture.frustrationInteractions.pageUrlAllowlist` | Optional. `(string\|RegExp)[]` | Defines the URL, URLs, or URL pattern on which Amplitude tracks element click and change events. By default, element interactions will be captured on any URL if undefined. | +| `config.autocapture.frustrationInteractions.pageUrlAllowlist` | Optional. `(string\|RegExp)[]` | Defines the URL, URLs, or URL pattern on which Amplitude tracks element click and change events. By default, frustration interactions will be captured on any URL if undefined. | | `config.autocapture.frustrationInteractions.dataAttributePrefix` | Optional. `(string\|RegExp)[]` | Allows the SDK to capture data attributes as an event property. By default, this is set to `data-amp-track`. | {{/partial:collapse}} From 2ec119d02c78bfd310c81e57edc52f05c6bcb621 Mon Sep 17 00:00:00 2001 From: Daniel Graham Date: Fri, 20 Jun 2025 12:36:01 -0700 Subject: [PATCH 4/4] again --- content/collections/browser_sdk/en/browser-sdk-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/collections/browser_sdk/en/browser-sdk-2.md b/content/collections/browser_sdk/en/browser-sdk-2.md index de7ec5782..7a2a8ae02 100644 --- a/content/collections/browser_sdk/en/browser-sdk-2.md +++ b/content/collections/browser_sdk/en/browser-sdk-2.md @@ -681,7 +681,7 @@ Use the advanced configuration to control frustration interaction tracking. {{/partial:collapse}} -{{partial:collapse name="Element interaction events"}} +{{partial:collapse name="Frustration interaction events"}} When you enable frustration interactions for Autocapture, Amplitude sends two events - `[Amplitude] Dead Click`