feat: Implement custom view tracking

This commit is contained in:
gpt-engineer-app[bot]
2025-10-10 15:53:56 +00:00
parent c39aba6994
commit 4d2d39fb5a
10 changed files with 288 additions and 58 deletions

View File

@@ -1,6 +1,7 @@
import { useState, useEffect } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { Header } from '@/components/layout/Header';
import { trackPageView } from '@/lib/viewTracking';
import { getBannerUrls } from '@/lib/cloudflareImageUtils';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
@@ -41,6 +42,13 @@ export default function OperatorDetail() {
}
}, [slug]);
// Track page view when operator is loaded
useEffect(() => {
if (operator?.id) {
trackPageView('company', operator.id);
}
}, [operator?.id]);
const fetchOperatorData = async () => {
try {
const { data, error } = await supabase