1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: track read about (#4478)

This commit is contained in:
Mateusz Kwasniewski 2023-08-11 09:59:23 +02:00 committed by GitHub
parent 90f5af6b61
commit 81586074d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -119,12 +119,18 @@ export const PremiumFeature = ({
const tracker = usePlausibleTracker(); const tracker = usePlausibleTracker();
const handleClick = () => { const trackUpgradePlan = () => {
tracker.trackEvent('upgrade_plan_clicked', { tracker.trackEvent('upgrade_plan_clicked', {
props: { feature: label }, props: { feature: label },
}); });
}; };
const trackReadAbout = () => {
tracker.trackEvent('read_about', {
props: { feature: label },
});
};
const featureLabel = Boolean(url) ? ( const featureLabel = Boolean(url) ? (
<StyledLink href={url} target="_blank" rel="noreferrer"> <StyledLink href={url} target="_blank" rel="noreferrer">
{label} {label}
@ -167,7 +173,7 @@ export const PremiumFeature = ({
href={upgradeUrl} href={upgradeUrl}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
onClick={handleClick} onClick={trackUpgradePlan}
> >
Compare plans Compare plans
</StyledLink> </StyledLink>
@ -191,11 +197,16 @@ export const PremiumFeature = ({
href={upgradeUrl} href={upgradeUrl}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
onClick={handleClick} onClick={trackUpgradePlan}
> >
Compare plans Compare plans
</Button> </Button>
<Button href={url} target="_blank" rel="noreferrer"> <Button
href={url}
target="_blank"
rel="noreferrer"
onClick={trackReadAbout}
>
Read about {label} Read about {label}
</Button> </Button>
</StyledButtonContainer> </StyledButtonContainer>

View File

@ -11,6 +11,7 @@ import { EventOptions, PlausibleOptions } from 'plausible-tracker';
export type CustomEvents = export type CustomEvents =
| 'invite' | 'invite'
| 'upgrade_plan_clicked' | 'upgrade_plan_clicked'
| 'read_about'
| 'change_request' | 'change_request'
| 'favorite' | 'favorite'
| 'maintenance' | 'maintenance'