Skip to content

Commit

Permalink
fix(language-menu): measure locale-redirct clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Sep 12, 2024
1 parent 4fbd6a4 commit d539049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ export const BASELINE = Object.freeze({

export const CLIENT_SIDE_NAVIGATION = "client_side_nav";
export const LANGUAGE = "language";
export const LANGUAGE_REDIRECT = "language_redirect";
export const THEME_SWITCHER = "theme_switcher";
export const SURVEY = "survey";
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Submenu } from "../../../molecules/submenu";
import "./index.scss";
import { DropdownMenu, DropdownMenuWrapper } from "../../../molecules/dropdown";
import { useLocale } from "../../../../hooks";
import { LANGUAGE } from "../../../../telemetry/constants";
import { LANGUAGE, LANGUAGE_REDIRECT } from "../../../../telemetry/constants";
import {
deleteCookie,
getCookieValue,
Expand Down Expand Up @@ -129,6 +129,7 @@ function LanguageMenuItem({

function LocaleRedirectSetting() {
const TRUE_VALUE = "true";
const gleanClick = useGleanClick();
const locale = useLocale();
const [value, setValue] = useState(false);

Expand All @@ -149,6 +150,7 @@ function LocaleRedirectSetting() {
deleteCookie(REDIRECT_LOCALE_COOKIE_NAME);
}
setValue(event.target.checked);
gleanClick(`${LANGUAGE_REDIRECT}: ${locale} -> ${Number(newValue)}`);
}

return (
Expand Down

0 comments on commit d539049

Please sign in to comment.