feat : add GA event on play game
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
Reference in New Issue
Block a user