mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: testing simple analytics and fathom analytics for better privacy of the users (#6529)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
45a57d70de
commit
6b0218b012
3 changed files with 36 additions and 30 deletions
|
@ -20,9 +20,20 @@ export const trackEvent = (
|
|||
});
|
||||
}
|
||||
|
||||
// MATOMO event tracking _paq must be same as the one in index.html
|
||||
if (window._paq) {
|
||||
window._paq.push(["trackEvent", category, action, label, value]);
|
||||
if (window.sa_event) {
|
||||
window.sa_event(action, {
|
||||
category,
|
||||
label,
|
||||
value,
|
||||
});
|
||||
}
|
||||
|
||||
if (window.fathom) {
|
||||
window.fathom.trackEvent(action, {
|
||||
category,
|
||||
label,
|
||||
value,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("error during analytics", error);
|
||||
|
|
4
src/global.d.ts
vendored
4
src/global.d.ts
vendored
|
@ -18,8 +18,8 @@ interface Window {
|
|||
EXCALIDRAW_EXPORT_SOURCE: string;
|
||||
EXCALIDRAW_THROTTLE_RENDER: boolean | undefined;
|
||||
gtag: Function;
|
||||
_paq: any[];
|
||||
_mtm: any[];
|
||||
sa_event: Function;
|
||||
fathom: { trackEvent: Function };
|
||||
}
|
||||
|
||||
interface CanvasRenderingContext2D {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue