diff --git a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx index 5181a02a06..8068a6770c 100644 --- a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx +++ b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx @@ -1,6 +1,6 @@ -import { type FormEventHandler, useEffect, useState, type FC } from 'react'; +import { type FC, type FormEventHandler, useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { Box, Paper, useTheme, styled, Alert } from '@mui/material'; +import { Alert, Box, Paper, styled, useTheme } from '@mui/material'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import useToast from 'hooks/useToast'; @@ -246,14 +246,27 @@ export const AdvancedPlayground: FC<{ } }; + const trackTryConfiguration = () => { + let mode: 'default' | 'api_token' | 'change_request' = 'default'; + if (token && token !== '') { + mode = 'api_token'; + } else if (changeRequest) { + mode = 'change_request'; + } + trackEvent('playground', { + props: { + eventType: 'try-configuration', + mode, + }, + }); + }; + const onSubmit: FormEventHandler = async (event) => { event.preventDefault(); setHasFormBeenSubmitted(true); - if (token && token !== '') { - trackEvent('playground_token_input_used'); - } + trackTryConfiguration(); await evaluatePlaygroundContext(environments, projects, context, () => { setURLParameters();