element-plus/docs/.vitepress/config/analytics.ts
0song 56fee15685
chore: add right sponsors (#7567)
* chore: add spon

* chore: add spon dark

* chore: add spon ui

* chore: add spon ui2

* chore: add analytics

* chore: add readme
2022-05-09 08:49:28 +08:00

16 lines
285 B
TypeScript

export const sendEvent = (
action: string,
label: string,
value?: any,
category?: string
): void => {
const gtag = (window as any).gtag
if (gtag) {
gtag('event', action, {
event_label: label,
event_value: value,
event_category: category,
})
}
}