feat : add GA event on play game

This commit is contained in:
GuillaumeSD
2024-03-20 20:03:16 +01:00
parent 9e497cb24b
commit f5bf7ecfdb
2 changed files with 8 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ import {
} from "../states";
import { useChessActions } from "@/hooks/useChessActions";
import { playGameStartSound } from "@/lib/sounds";
import { logAnalyticsEvent } from "@/lib/firebase";
interface Props {
open: boolean;
@@ -52,6 +53,12 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
});
playGameStartSound();
setIsGameInProgress(true);
logAnalyticsEvent("play_game", {
engine: EngineName.Stockfish16,
skillLevel,
playerColor,
});
};
return (