Files
crawlab/frontend/src/utils/admin.ts
2021-07-21 16:56:18 +08:00

12 lines
385 B
TypeScript

export const sendPv = (page: any) => {
if (localStorage.getItem('useStats') !== '0') {
window._hmt?.push(['_trackPageview', page]);
}
};
export const sendEv = (category: string, eventName: string, optLabel: string, optValue: string) => {
if (localStorage.getItem('useStats') !== '0') {
window._hmt?.push(['_trackEvent', category, eventName, optLabel, optValue]);
}
};