Skip to content
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

fix(telemetry): measure link/button clicks properly #10707

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Mar 14, 2024

Summary

(Related: MP-906)

Problem

We assumed that the click happens on the element with data-glean, but this is not guaranteed if the link/button has children.

Solution

Determine the closest link/button before checking for the data-glean attribute.


How did you test this change?

Tested locally. Clicked in the sidebar banner (a) on the image, (b) on the text, and (c) slightly below the text, and verified that the click is measured in all three cases.

We assumed that the click happens on the element with data-glean,
but this is not guaranteed if the link/button has children.
@caugner caugner requested a review from a team as a code owner March 14, 2024 15:31
@caugner caugner requested a review from fiji-flo March 14, 2024 15:32
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

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

Thanks for fixing. Looks great.

@caugner caugner merged commit 2c27a78 into main Mar 14, 2024
13 of 14 checks passed
@caugner caugner deleted the fix-glean-click-handler branch March 14, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants