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