Skip to content

feat(analytics-browser): add dead + rage clicks to analytics-browser #1162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 44 commits into
base: frustration-analytics
Choose a base branch
from

Conversation

daniel-graham-amplitude
Copy link
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude commented Jun 23, 2025

Summary

Add public API for capturing dead clicks and rage clicks via a new configuration called "autocapture.frustrationInteractions".

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as draft June 23, 2025 23:35
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debug Statement Left In Code

A debug console.log('!!!options', options); statement was accidentally left in the code and should be removed to prevent console output pollution.

packages/plugin-autocapture-browser/src/frustration-plugin.ts#L36-L37

): BrowserEnrichmentPlugin => {
console.log('!!!options', options);

Fix in Cursor


Bug: Test Name Mismatch

The test name for isFrustrationInteractionsEnabled with an undefined parameter ("should return true with undefined parameter") contradicts its assertion (toBe(false)). The test name should be updated to "should return false with undefined parameter" to accurately reflect the expected behavior.

packages/analytics-browser/test/default-tracking.test.ts#L21-L24

test('should return true with undefined parameter', () => {
expect(isFrustrationInteractionsEnabled(undefined)).toBe(false);
});

Fix in Cursor


Comment bugbot run to trigger another review on this PR
Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link

promptless bot commented Jun 23, 2025

📝 Documentation updates detected!

New suggestion: Document frustrationInteractions autocapture option for Browser SDK

@daniel-graham-amplitude daniel-graham-amplitude changed the base branch from main to frustration-analytics June 26, 2025 20:41
@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as ready for review June 26, 2025 20:45
Copy link

promptless bot commented Jun 26, 2025

✅ No documentation updates required.

Copy link
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! See nit.

@@ -160,6 +161,11 @@ export interface AutocaptureOptions {
* @defaultValue `false`
*/
elementInteractions?: boolean | ElementInteractionsOptions;
/**
* Enables/disables frustration interactions tracking.
* @defaultValue `false`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the code it looks like the default value is true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be "false" by default. Just like elementInteractions. Is it not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented "isFrustrationInteractionsEnabled" the same as "isElementInteractionsEnabled" so it should be the same

@daniel-graham-amplitude daniel-graham-amplitude changed the base branch from frustration-analytics to frustration-analytics-1 July 4, 2025 20:52
@daniel-graham-amplitude daniel-graham-amplitude force-pushed the AMP-125613/config-prerelease branch from 06b3905 to 87970f9 Compare July 4, 2025 20:54
@daniel-graham-amplitude daniel-graham-amplitude changed the base branch from frustration-analytics-1 to frustration-analytics July 4, 2025 20:54
@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as draft July 10, 2025 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants