From a6e66aa02a3f167640d072c30e7b58caecf5ed6f Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Sun, 1 Sep 2024 17:30:40 +0300 Subject: [PATCH] add set_content event --- src/store/useFile.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/store/useFile.ts b/src/store/useFile.ts index 6d8e25d..d4fe367 100644 --- a/src/store/useFile.ts +++ b/src/store/useFile.ts @@ -1,4 +1,5 @@ import debounce from "lodash.debounce"; +import { event as gaEvent } from "nextjs-google-analytics"; import { toast } from "react-hot-toast"; import { create } from "zustand"; import { defaultJson } from "src/constants/data"; @@ -79,6 +80,7 @@ const useFile = create()((set, get) => ({ setFile: fileData => { set({ fileData, format: fileData.format || FileFormat.JSON }); get().setContents({ contents: fileData.content, hasChanges: false }); + gaEvent("set_content", { label: fileData.format }); }, getContents: () => get().contents, getFormat: () => get().format,