File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 "react-dnd" : " ^14.0.2" ,
1414 "react-dnd-html5-backend" : " ^14.0.0" ,
1515 "react-dom" : " ^17.0.2" ,
16- "react-ga" : " ^3.3.0" ,
1716 "react-hook-form" : " ^7.12.2" ,
1817 "react-router-dom" : " ^5.2.0" ,
1918 "react-scripts" : " 4.0.3" ,
Original file line number Diff line number Diff line change 11import React , { useState , useContext , memo } from "react" ;
22import { useForm } from "react-hook-form" ;
3- import ReactGA from "react-ga" ;
43
54//Scripts
65import { dataContext } from "../../context/dataContext" ;
@@ -75,8 +74,8 @@ const ModalTag = ({ hideModal, showModal }) => {
7574 auxArr . push ( auxObj ) ;
7675 setTagList ( auxArr ) ;
7776
78- ReactGA . event ( {
79- category : "Create" ,
77+ window . gtag ( "event" , "click-event" , {
78+ event_category : "Create" ,
8079 action : "Creating a new tag" ,
8180 label : "Tag Creation" ,
8281 } ) ;
Original file line number Diff line number Diff line change 11import React , { useState , useContext , memo } from "react" ;
22import { useForm } from "react-hook-form" ;
3- import ReactGA from "react-ga" ;
43
54//Scripts
65import { dataContext } from "../../context/dataContext" ;
@@ -87,8 +86,8 @@ const ModalTodo = ({ hideModal, showModal }) => {
8786 todoArr . push ( todoObj ) ;
8887 setTodoList ( todoArr ) ;
8988
90- ReactGA . event ( {
91- category : "Create" ,
89+ window . gtag ( "event" , "click-event" , {
90+ event_category : "Create" ,
9291 action : "Creating a new todo" ,
9392 label : "Todo Creation" ,
9493 } ) ;
Original file line number Diff line number Diff line change 11import React , { useState , useContext } from "react" ;
2- import ReactGA from "react-ga" ;
32//Context
43import { dataContext } from "../../context/dataContext.js" ;
54
@@ -27,8 +26,8 @@ const SideBar = () => {
2726 const [ searchValue , setSearchValue ] = useState ( "" ) ;
2827
2928 function handleClickAdd ( ) {
30- ReactGA . event ( {
31- category : "Open" ,
29+ window . gtag ( "event" , "click-event" , {
30+ event_category : "Open" ,
3231 action : "Openned tag creation modal" ,
3332 label : "Tag Modal" ,
3433 } ) ;
Original file line number Diff line number Diff line change 11import React , { useContext , useState , useEffect } from "react" ;
22import { Col , Drawer } from "antd" ;
3- import ReactGA from "react-ga" ;
43
54//Minor Components
65import {
@@ -23,7 +22,6 @@ import ModalTodo from "../../components/Modal/modalTodo";
2322
2423import { ToastContainer } from "react-toastify" ;
2524
26- ReactGA . initialize ( 'G-JF1788P5N0' ) ;
2725
2826const App = ( ) => {
2927 const [ showModal , setShowModal ] = useState ( false ) ;
@@ -41,18 +39,13 @@ const App = () => {
4139 }
4240 } , [ ] )
4341
44- useEffect ( ( ) => {
45-
46- //to report page view
47- ReactGA . pageview ( window . location . pathname + window . location . search ) ;
48- } , [ ] )
4942
5043 function handleClickAdd ( ) {
51- ReactGA . event ( {
52- category : ' Open' ,
53- action : ' Openned todo creation modal' ,
54- label : ' Todo Modal'
55- } ) ;
44+ window . gtag ( "event" , "click-event" , {
45+ event_category : " Open" ,
46+ action : " Openned todo creation modal" ,
47+ label : " Todo Modal"
48+ } )
5649 setShowModal ( true ) ;
5750 }
5851
You can’t perform that action at this time.
0 commit comments