mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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:
		
							parent
							
								
									065e588e64
								
							
						
					
					
						commit
						3b0b372f75
					
				@ -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({
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user