mirror of
https://github.com/langgenius/dify.git
synced 2026-04-24 00:59:19 +08:00
refactor: update Google Analytics component to use window.gtag for event tracking
This commit is contained in:
parent
ab6e00a6c1
commit
69eb38060d
@ -34,10 +34,10 @@ const GA: FC<IGAProps> = ({
|
|||||||
strategy="afterInteractive"
|
strategy="afterInteractive"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(){dataLayer.push(arguments);}
|
window.gtag = function gtag(){window.dataLayer.push(arguments);};
|
||||||
gtag('js', new Date());
|
window.gtag('js', new Date());
|
||||||
gtag('config', '${gaIdMaps[gaType]}');
|
window.gtag('config', '${gaIdMaps[gaType]}');
|
||||||
`,
|
`,
|
||||||
}}
|
}}
|
||||||
nonce={nonce ?? undefined}
|
nonce={nonce ?? undefined}
|
||||||
@ -56,7 +56,6 @@ gtag('config', '${gaIdMaps[gaType]}');
|
|||||||
nonce={nonce ?? undefined}
|
nonce={nonce ?? undefined}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default React.memo(GA)
|
export default React.memo(GA)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user