From 419640fb2b7d69de0cc96d75397bf9c85f824ac4 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Tue, 13 Dec 2022 14:35:07 +0200 Subject: [PATCH] Add unique trackable URLs for Pro/Enterprise feature lead generation (#2684) Add unique trackable URLs for Pro/Enterprise feature lead generation --- .../ProjectChangeRequests.tsx | 2 +- .../common/PremiumFeature/PremiumFeature.tsx | 23 +++++++++++-------- .../ChangeRequestConfiguration.tsx | 2 +- .../project/ProjectAccess/ProjectAccess.tsx | 2 +- .../project/ProjectList/ProjectList.tsx | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/frontend/src/component/changeRequest/ProjectChangeRequests/ProjectChangeRequests.tsx b/frontend/src/component/changeRequest/ProjectChangeRequests/ProjectChangeRequests.tsx index c8d4f72bbd..51df5cc195 100644 --- a/frontend/src/component/changeRequest/ProjectChangeRequests/ProjectChangeRequests.tsx +++ b/frontend/src/component/changeRequest/ProjectChangeRequests/ProjectChangeRequests.tsx @@ -19,7 +19,7 @@ export const ProjectChangeRequests = () => { if (isOss() || isPro()) { return ( - + ); } diff --git a/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx b/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx index 1e167c1867..dd217ccd28 100644 --- a/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx +++ b/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx @@ -46,17 +46,20 @@ enum FeaturePlan { } const PremiumFeatures = { - ['Adding new projects']: { + 'adding-new-projects': { plan: FeaturePlan.PRO, url: '', + label: 'Adding new projects', }, - ['Access']: { + access: { plan: FeaturePlan.PRO, url: 'https://docs.getunleash.io/reference/rbac', + label: 'Access', }, - ['Change Requests']: { + 'change-requests': { plan: FeaturePlan.ENTERPRISE, url: 'https://docs.getunleash.io/reference/change-requests', + label: 'Change Requests', }, }; @@ -70,22 +73,22 @@ export interface PremiumFeatureProps { } export const PremiumFeature = ({ feature, tooltip }: PremiumFeatureProps) => { - const { url, plan } = PremiumFeatures[feature]; + const { url, plan, label } = PremiumFeatures[feature]; const tracker = usePlausibleTracker(); const handleClick = () => { tracker.trackEvent('upgrade_plan_clicked', { - props: { feature }, + props: { feature: label }, }); }; const featureLabel = Boolean(url) ? ( - {feature} + {label} ) : ( - feature + label ); const featureMessage = ( @@ -96,6 +99,8 @@ export const PremiumFeature = ({ feature, tooltip }: PremiumFeatureProps) => { ); + const upgradeUrl = `${UPGRADE_URL}?feature=${feature}`; + return ( @@ -114,7 +119,7 @@ export const PremiumFeature = ({ feature, tooltip }: PremiumFeatureProps) => { @@ -137,7 +142,7 @@ export const PremiumFeature = ({ feature, tooltip }: PremiumFeatureProps) => {