Skip to content

Commit 0ee2311

Browse files
authored
feat: added matomo event for attestation verifications (#46)
1 parent 95e4e63 commit 0ee2311

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

web/components/FileUploadInput/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ export default function FileUploadInput(props: {
88
disabled?: boolean;
99
loading?: boolean;
1010
}) {
11+
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
12+
props.onFileChange(e);
13+
14+
if (typeof window !== 'undefined' && window._paq && e.target.files?.length) {
15+
window._paq.push(['trackEvent', 'AttestationUpload', 'File', 'Uploaded']);
16+
}
17+
};
18+
1119
return (
1220
<div
1321
className={classNames(
@@ -30,7 +38,7 @@ export default function FileUploadInput(props: {
3038
<input
3139
type="file"
3240
className="absolute w-full h-full top-0 left-0 opacity-0 z-10 cursor-pointer"
33-
onChange={props.onFileChange}
41+
onChange={handleFileChange}
3442
accept=".json"
3543
disabled={props.disabled || props.loading}
3644
/>

0 commit comments

Comments
 (0)