window.Analytics = () => {
  // 🔥 আপনার আসল Measurement ID বসানো হয়েছে
  const G_TAG_ID = "G-BSCMW0ZM1E";
  
  React.useEffect(() => {
    // যদি স্ক্রিপ্ট আগে থেকেই থাকে তবে আর লোড করবে না
    if (document.getElementById('google-analytics-script')) return;
    
    // 1. Google Script লোড করা
    const script = document.createElement('script');
    script.id = 'google-analytics-script';
    script.src = `https://www.googletagmanager.com/gtag/js?id=${G_TAG_ID}`;
    script.async = true;
    document.head.appendChild(script);
    
    // 2. কনফিগারেশন সেট করা
    window.dataLayer = window.dataLayer || [];
    
    function gtag() { window.dataLayer.push(arguments); }
    gtag('js', new Date());
    gtag('config', G_TAG_ID, {
      page_path: window.location.pathname,
    });
    
    console.log("🚀 SEO System: Google Analytics Connected! ID: " + G_TAG_ID);
    
  }, []);
  
  return null; // এটি দৃশ্যমান কিছু দেখাবে না, ব্যাকগ্রাউন্ডে কাজ করবে
};