diff --git a/components/Ackee.js b/components/Ackee.js index 63b47037..dd9467f0 100644 --- a/components/Ackee.js +++ b/components/Ackee.js @@ -4,10 +4,11 @@ import { useEffect } from 'react' import BLOG from '@/blog.config' import { loadExternalResource } from '@/lib/utils' import { useRouter } from 'next/router' - const Ackee = () => { const router = useRouter() - useEffect(() => { + + // handleAckee 函数 + const handleAckeeCallback = () => { handleAckee( router.asPath, { @@ -15,10 +16,28 @@ const Ackee = () => { domainId: BLOG.ANALYTICS_ACKEE_DOMAIN_ID }, { - detailed: false, - ignoreLocalhost: false + /* + * Enable or disable tracking of personal data. + * We recommend to ask the user for permission before turning this option on. + */ + detailed: true, + /* + * Enable or disable tracking when on localhost. + */ + ignoreLocalhost: false, + /* + * Enable or disable the tracking of your own visits. + * This is enabled by default, but should be turned off when using a wildcard Access-Control-Allow-Origin header. + * Some browsers strictly block third-party cookies. The option won't have an impact when this is the case. + */ + ignoreOwnVisits: false } ) + } + + // 或者使用其他依赖数组,根据需要执行 handleAckee + useEffect(() => { + handleAckeeCallback() }, [router]) return null diff --git a/components/CommonScript.js b/components/CommonScript.js index 6912c3cc..4bef4da0 100644 --- a/components/CommonScript.js +++ b/components/CommonScript.js @@ -56,12 +56,12 @@ const CommonScript = () => { {/* 代码统计 */} {/* ackee统计脚本 */} - {BLOG.ANALYTICS_ACKEE_TRACKER && ( + {/* {BLOG.ANALYTICS_ACKEE_TRACKER && (