diff --git a/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx b/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx index 717be6f9a0..2c969e7717 100644 --- a/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx +++ b/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx @@ -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) ? ( {label} @@ -167,7 +173,7 @@ export const PremiumFeature = ({ href={upgradeUrl} target="_blank" rel="noreferrer" - onClick={handleClick} + onClick={trackUpgradePlan} > Compare plans @@ -191,11 +197,16 @@ export const PremiumFeature = ({ href={upgradeUrl} target="_blank" rel="noreferrer" - onClick={handleClick} + onClick={trackUpgradePlan} > Compare plans - diff --git a/frontend/src/hooks/usePlausibleTracker.ts b/frontend/src/hooks/usePlausibleTracker.ts index 6a248e60c1..1136c06b67 100644 --- a/frontend/src/hooks/usePlausibleTracker.ts +++ b/frontend/src/hooks/usePlausibleTracker.ts @@ -11,6 +11,7 @@ import { EventOptions, PlausibleOptions } from 'plausible-tracker'; export type CustomEvents = | 'invite' | 'upgrade_plan_clicked' + | 'read_about' | 'change_request' | 'favorite' | 'maintenance'