This commit is contained in:
hzm
2026-02-21 12:54:14 +08:00
parent f691435f22
commit 22f05061ab
9 changed files with 21 additions and 13 deletions

View File

@@ -1,17 +1,9 @@
'use client';
import { useEffect, useState } from 'react';
import Script from 'next/script';
export default function AnalyticsGate({ GA_ID }) {
const [enabled, setEnabled] = useState(false);
useEffect(() => {
try {
const href = window.location.href || '';
setEnabled(href.includes('hzm0321'));
} catch {}
}, []);
if (!enabled) return null;
if (!GA_ID) return null;
return (
<>