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

chore(telemetry): measure menu clicks #9918

Merged
merged 5 commits into from
Oct 31, 2023
Merged

chore(telemetry): measure menu clicks #9918

merged 5 commits into from
Oct 31, 2023

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Oct 31, 2023

Summary

Problem

We don't know how many users click on the menu items in the top navigation (main menu and user menu).

Solution

Add measurements.


How did you test this change?

Ran yarn && yarn dev with the following environment variables (in .env):

REACT_APP_GLEAN_DEBUG=true
REACT_APP_GLEAN_ENABLED=true

Then visited http://localhost:3000/en-US/, clicked on menu and submenu items and verified that these show up in our Glean debug pings viewer.

@caugner caugner requested a review from a team as a code owner October 31, 2023 17:25
@@ -58,6 +61,9 @@ export const Submenu = ({
className={`submenu-item ${
item.url.startsWith("https://") ? "external" : ""
}`}
onClick={() =>
gleanClick(`${MENU.CLICK_SUBMENU}: ${item.url}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

That's used in a lot of places, maybe we want to add something like gleanEnabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we only measure clicks on submenu items with a url, this will effectively only measure clicks on the main menu and on the user menu. To distinguish these, I now added the menu id to the click source.

@caugner caugner requested a review from fiji-flo October 31, 2023 18:57
@caugner caugner changed the title chore(telemetry): measure Menu/Submenu clicks chore(telemetry): measure menu clicks Oct 31, 2023
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.

👍

@fiji-flo fiji-flo merged commit c4c5d79 into main Oct 31, 2023
@fiji-flo fiji-flo deleted the measure-menu-clicks branch October 31, 2023 21:36
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