mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
refactor: change plausible events to be more specific at the top level (#3810)
Splits the `demo` event into multiple more specific events so it's easier to track on Plausible (fix `(none)` in Plausible).
This commit is contained in:
parent
e1dd1701cc
commit
0c538f070a
@ -68,11 +68,7 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
const onFinish = () => {
|
||||
setFinishOpen(true);
|
||||
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'finish',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-finish');
|
||||
};
|
||||
|
||||
const closeGuide = () => {
|
||||
@ -91,11 +87,7 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
|
||||
setPlansOpen(true);
|
||||
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'see_plans',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-see-plans');
|
||||
}}
|
||||
/>
|
||||
{children}
|
||||
@ -106,10 +98,10 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
|
||||
setExpanded(false);
|
||||
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-close', {
|
||||
props: {
|
||||
eventType: 'close',
|
||||
topic: 'start',
|
||||
topic: 'welcome',
|
||||
step: 'welcome',
|
||||
},
|
||||
});
|
||||
}}
|
||||
@ -118,11 +110,7 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
|
||||
onStart();
|
||||
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'start',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-start');
|
||||
}}
|
||||
/>
|
||||
<DemoDialogFinish
|
||||
@ -135,11 +123,7 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
setFinishOpen(false);
|
||||
onStart();
|
||||
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'restart',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-restart');
|
||||
}}
|
||||
/>
|
||||
<DemoDialogPlans
|
||||
@ -158,10 +142,9 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
setWelcomeOpen(false);
|
||||
setPlansOpen(false);
|
||||
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-start-topic', {
|
||||
props: {
|
||||
eventType: 'start_topic',
|
||||
step: TOPICS[topic].title,
|
||||
topic: TOPICS[topic].title,
|
||||
},
|
||||
});
|
||||
}}
|
||||
@ -172,11 +155,7 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => {
|
||||
|
||||
setWelcomeOpen(true);
|
||||
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'view_demo_link',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-view-demo-link');
|
||||
}}
|
||||
/>
|
||||
<DemoSteps
|
||||
|
@ -47,11 +47,7 @@ export const DemoBanner = ({ onPlans }: IDemoBannerProps) => {
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={() => {
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'ask_questions',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-ask-questions');
|
||||
}}
|
||||
>
|
||||
Ask questions
|
||||
|
@ -79,9 +79,8 @@ export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => {
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={() => {
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-see-plan', {
|
||||
props: {
|
||||
eventType: 'see_plan',
|
||||
plan: 'open_source',
|
||||
},
|
||||
});
|
||||
@ -113,9 +112,8 @@ export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => {
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={() => {
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-see-plan', {
|
||||
props: {
|
||||
eventType: 'see_plan',
|
||||
plan: 'pro',
|
||||
},
|
||||
});
|
||||
@ -145,9 +143,8 @@ export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => {
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={() => {
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-see-plan', {
|
||||
props: {
|
||||
eventType: 'see_plan',
|
||||
plan: 'enterprise',
|
||||
},
|
||||
});
|
||||
@ -162,9 +159,8 @@ export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => {
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={() => {
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-see-plan', {
|
||||
props: {
|
||||
eventType: 'see_plan',
|
||||
plan: 'compare_plans',
|
||||
},
|
||||
});
|
||||
|
@ -83,11 +83,7 @@ export const DemoDialogWelcome = ({
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={() => {
|
||||
trackEvent('demo', {
|
||||
props: {
|
||||
eventType: 'open_demo_web',
|
||||
},
|
||||
});
|
||||
trackEvent('demo-open-demo-web');
|
||||
}}
|
||||
>
|
||||
hello.unleash.run <Launch />
|
||||
|
@ -61,9 +61,8 @@ export const DemoSteps = ({
|
||||
abortController.abort();
|
||||
setTopicStep(-1);
|
||||
|
||||
trackEvent('demo', {
|
||||
trackEvent('demo-close', {
|
||||
props: {
|
||||
eventType: 'close',
|
||||
topic: topics[topic].title,
|
||||
step: step + 1,
|
||||
},
|
||||
|
@ -25,8 +25,18 @@ export type CustomEvents =
|
||||
| 'notifications'
|
||||
| 'batch_operations'
|
||||
| 'strategyTitle'
|
||||
| 'default_strategy'
|
||||
| 'demo'
|
||||
| 'default_strategy';
|
||||
| 'demo-start'
|
||||
| 'demo-close'
|
||||
| 'demo-finish'
|
||||
| 'demo-see-plans'
|
||||
| 'demo-see-plan'
|
||||
| 'demo-restart'
|
||||
| 'demo-view-demo-link'
|
||||
| 'demo-start-topic'
|
||||
| 'demo-ask-questions'
|
||||
| 'demo-open-demo-web';
|
||||
|
||||
export const usePlausibleTracker = () => {
|
||||
const plausible = useContext(PlausibleContext);
|
||||
|
Loading…
Reference in New Issue
Block a user