Skip to content

Commit

Permalink
Add event tracking for unlocking achievements
Browse files Browse the repository at this point in the history
  • Loading branch information
nasubi-dev committed Sep 29, 2024
1 parent 2783a3b commit 60542f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/unlocked/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export default function Page(): ReactElement {
setIsUILocked(true);

try {
if (isUnlocked) {
ReactGA.event("unlocked");
// eslint-disable-next-line no-console
console.log("unlocked");
}
await update(
isUnlocked
? [
Expand All @@ -59,7 +64,6 @@ export default function Page(): ReactElement {
({ achievementID: id }) => id !== targetAchievementId,
),
);
ReactGA.event("unlocked achievement");
await mutate();
} finally {
setIsUILocked(false);
Expand Down

0 comments on commit 60542f8

Please sign in to comment.