1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: playground token input usage tracking (#5157)

Track usage of the new token input

Closes #
[1-1551](https://linear.app/unleash/issue/1-1551/plausible-track-usage-of-token-input)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2023-10-26 14:28:12 +03:00 committed by GitHub
parent 065e588e64
commit 3b0b372f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -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({

View File

@ -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);