mirror of
https://github.com/langgenius/dify.git
synced 2026-02-16 16:04:42 +08:00
- Added types for Google Analytics gtag and implemented event tracking in user registration flows. - Updated Content Security Policy to allow 'wasm-unsafe-eval' in script sources. - Refactored GA component to improve nonce handling and script loading strategy. - Cleaned up UTM info cookies after successful user registration.
13 lines
308 B
TypeScript
13 lines
308 B
TypeScript
/**
|
|
* Send Google Analytics event
|
|
* @param eventName - event name
|
|
* @param eventParams - event params
|
|
*/
|
|
export const sendGAEvent = (
|
|
eventName: string,
|
|
eventParams?: GtagEventParams,
|
|
): void => {
|
|
if (typeof window !== 'undefined' && window.gtag)
|
|
window.gtag('event', eventName, eventParams)
|
|
}
|