diff --git a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx index d0e00bb063..b1cf2701eb 100644 --- a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx +++ b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx @@ -22,6 +22,7 @@ import { AdvancedPlaygroundResultsTable } from './AdvancedPlaygroundResultsTable import { AdvancedPlaygroundResponseSchema } from 'openapi'; import { createLocalStorage } from 'utils/createLocalStorage'; import { BadRequestError } from 'utils/apiUtils'; +import { usePlausibleTracker } from '../../../hooks/usePlausibleTracker'; const StyledAlert = styled(Alert)(({ theme }) => ({ marginBottom: theme.spacing(3), @@ -40,6 +41,7 @@ export const AdvancedPlayground: VFC<{ 'AdvancedPlayground:v1', defaultSettings, ); + const { trackEvent } = usePlausibleTracker(); const { environments: availableEnvironments } = useEnvironments(); const theme = useTheme(); @@ -182,6 +184,10 @@ export const AdvancedPlayground: VFC<{ setHasFormBeenSubmitted(true); + if (token) { + trackEvent('playground_token_input_used'); + } + await evaluatePlaygroundContext(environments, projects, context, () => { setURLParameters(); setValue({ diff --git a/frontend/src/hooks/usePlausibleTracker.ts b/frontend/src/hooks/usePlausibleTracker.ts index 00f1a60a00..d1979e1502 100644 --- a/frontend/src/hooks/usePlausibleTracker.ts +++ b/frontend/src/hooks/usePlausibleTracker.ts @@ -50,7 +50,8 @@ export type CustomEvents = | 'feature-naming-pattern' | 'project-mode' | 'dependent_features' - | 'oss-segments-splash-screen'; + | 'oss-segments-splash-screen' + | 'playground_token_input_used'; export const usePlausibleTracker = () => { const plausible = useContext(PlausibleContext);