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

@@ -52,7 +52,7 @@ export default function AnalyzeButton() {
engine: EngineName.Stockfish16, engine: EngineName.Stockfish16,
depth: engineDepth, depth: engineDepth,
multiPv: engineMultiPv, multiPv: engineMultiPv,
nbPositions: 1, nbPositions: params.fens.length,
}); });
}; };

View File

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