add page view analytics to the NewProposal

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-02-18 17:37:10 +03:00
parent d30dc0dc74
commit 675c0904af
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
2 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.5.18",
"version": "0.5.19",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -1,4 +1,5 @@
import { useState, useMemo, useCallback, useEffect } from "react";
import ReactGA from "react-ga4";
import {
Box,
@ -65,6 +66,10 @@ const NewProposal = ({ config, address, connect, chainId }) => {
localStorage.setItem(MY_PROPOSALS_PREFIX, toStore);
}, [myProposals]);
useEffect(() => {
ReactGA.send({ hitType: "pageview", page: "/governance/create" });
}, []);
const addCalldata = (calldata) => setProposalFunctions(prev => [...prev, calldata]);
const removeCalldata = (index) => setProposalFunctions(prev => prev.filter((_, i) => i !== index));