feat: track user interest in paid plans and enhance admin analytics
- Added tracking for user interest in the pro plan on the PricingPage. - Implemented auto-retry for CSRF token failures in API response interceptor. - Introduced new interfaces and API functions for enhanced admin analytics, including ratings, tool usage, user stats, plan interest, and system health.
This commit is contained in:
@@ -37,6 +37,13 @@ export default function PricingPage() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function handleUpgrade(billing: 'monthly' | 'yearly') {
|
||||
// Track interest in paid plan
|
||||
try {
|
||||
await api.post('/internal/admin/plan-interest/record', { plan: 'pro', billing });
|
||||
} catch {
|
||||
// Non-critical — don't block the flow
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
window.location.href = '/account?redirect=pricing';
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user