1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +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 handleClick = () => {
const trackUpgradePlan = () => {
tracker.trackEvent('upgrade_plan_clicked', {
props: { feature: label },
});
};
const trackReadAbout = () => {
tracker.trackEvent('read_about', {
props: { feature: label },
});
};
const featureLabel = Boolean(url) ? (
<StyledLink href={url} target="_blank" rel="noreferrer">
{label}
@ -167,7 +173,7 @@ export const PremiumFeature = ({
href={upgradeUrl}
target="_blank"
rel="noreferrer"
onClick={handleClick}
onClick={trackUpgradePlan}
>
Compare plans
</StyledLink>
@ -191,11 +197,16 @@ export const PremiumFeature = ({
href={upgradeUrl}
target="_blank"
rel="noreferrer"
onClick={handleClick}
onClick={trackUpgradePlan}
>
Compare plans
</Button>
<Button href={url} target="_blank" rel="noreferrer">
<Button
href={url}
target="_blank"
rel="noreferrer"
onClick={trackReadAbout}
>
Read about {label}
</Button>
</StyledButtonContainer>

View File

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