mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 04:31:13 -05:00
feat: Implement custom view tracking
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user