diff --git a/newIDE/app/src/GameDashboard/GameDetails.js b/newIDE/app/src/GameDashboard/GameDetails.js index b1b48776406a..a48a68526941 100644 --- a/newIDE/app/src/GameDashboard/GameDetails.js +++ b/newIDE/app/src/GameDashboard/GameDetails.js @@ -44,6 +44,7 @@ import { GameAnalyticsPanel } from './GameAnalyticsPanel'; import GameFeedback from './Feedbacks/GameFeedback'; import { GameMonetization } from './Monetization/GameMonetization'; import RouterContext from '../MainFrame/RouterContext'; +import { sendGameDetailsOpened } from '../Utils/Analytics/EventSender'; export type GameDetailsTab = | 'details' @@ -88,6 +89,7 @@ type Props = {| onLoading: boolean => void, currentTab: GameDetailsTab, setCurrentTab: GameDetailsTab => void, + analyticsSource: 'profile' | 'homepage' | 'projectManager', |}; const GameDetails = ({ @@ -98,6 +100,7 @@ const GameDetails = ({ onLoading, currentTab, setCurrentTab, + analyticsSource, }: Props) => { const { routeArguments, removeRouteArguments } = React.useContext( RouterContext @@ -157,6 +160,13 @@ const GameDetails = ({ [loadPublicGame] ); + React.useEffect( + () => { + sendGameDetailsOpened({ from: analyticsSource }); + }, + [analyticsSource] + ); + const handleGameUpdated = React.useCallback( (updatedGame: Game) => { // Set Public Game to null to show the loader. diff --git a/newIDE/app/src/GameDashboard/GameDetailsDialog.js b/newIDE/app/src/GameDashboard/GameDetailsDialog.js index 2a2b2d05d11e..103722364a3f 100644 --- a/newIDE/app/src/GameDashboard/GameDetailsDialog.js +++ b/newIDE/app/src/GameDashboard/GameDetailsDialog.js @@ -18,6 +18,7 @@ type Props = {| onClose: () => void, onGameUpdated: (updatedGame: Game) => void, onGameDeleted: () => void, + analyticsSource: 'profile' | 'homepage' | 'projectManager', |}; export const GameDetailsDialog = ({ @@ -26,6 +27,7 @@ export const GameDetailsDialog = ({ onClose, onGameUpdated, onGameDeleted, + analyticsSource, }: Props) => { const [isLoading, setIsLoading] = React.useState(false); const [currentTab, setCurrentTab] = React.useState('details'); @@ -75,6 +77,7 @@ export const GameDetailsDialog = ({ onLoading={setIsLoading} currentTab={currentTab} setCurrentTab={setCurrentTab} + analyticsSource={analyticsSource} /> )} diff --git a/newIDE/app/src/MainFrame/EditorContainers/HomePage/ManageSection/index.js b/newIDE/app/src/MainFrame/EditorContainers/HomePage/ManageSection/index.js index 6c0360108f6c..a7c7a20667c5 100644 --- a/newIDE/app/src/MainFrame/EditorContainers/HomePage/ManageSection/index.js +++ b/newIDE/app/src/MainFrame/EditorContainers/HomePage/ManageSection/index.js @@ -108,6 +108,7 @@ const ManageSection = ({ onLoading={() => {}} currentTab={currentTab} setCurrentTab={setCurrentTab} + analyticsSource="homepage" /> diff --git a/newIDE/app/src/Profile/ProfileDialog.js b/newIDE/app/src/Profile/ProfileDialog.js index 9ac20bc060bf..7861fb85af8c 100644 --- a/newIDE/app/src/Profile/ProfileDialog.js +++ b/newIDE/app/src/Profile/ProfileDialog.js @@ -320,6 +320,7 @@ const ProfileDialog = ({ currentProject, open, onClose }: Props) => { setOpenedGame(null); fetchGames(); }} + analyticsSource="profile" /> )} diff --git a/newIDE/app/src/Utils/Analytics/EventSender.js b/newIDE/app/src/Utils/Analytics/EventSender.js index 905ab675487b..97f17cbadcdb 100644 --- a/newIDE/app/src/Utils/Analytics/EventSender.js +++ b/newIDE/app/src/Utils/Analytics/EventSender.js @@ -192,6 +192,12 @@ export const sendExportLaunched = (exportKind: string) => { }); }; +export const sendGameDetailsOpened = (options: { + from: 'profile' | 'homepage' | 'projectManager', +}) => { + recordEvent('game_details_opened', options); +}; + export const sendExampleDetailsOpened = (slug: string) => { recordEvent('example-details-opened', { slug }); };