File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
ui/src/containers/ConfigScreen Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,16 @@ import "tippy.js/dist/tippy.css";
2020import "./styles.scss" ;
2121
2222import useJsErrorTracker from "../../hooks/useJsErrorTracker" ;
23+ import { useAppSdk } from "../../hooks/useAppSdk" ;
24+ import useAnalytics from "../../hooks/useAnalytics" ;
2325
2426const ConfigScreen : React . FC = function ( ) {
2527
2628 // error tracking hooks
2729 const { addMetadata, trackError } = useJsErrorTracker ( ) ;
30+ const { trackEvent } = useAnalytics ( ) ;
31+ const [ appSdk ] = useAppSdk ( ) ;
32+
2833
2934 const [ state , setState ] = useState < TypeAppSdkConfigState > ( {
3035 installationData : {
@@ -45,7 +50,7 @@ const ConfigScreen: React.FC = function () {
4550
4651 useEffect ( ( ) => {
4752 ContentstackAppSdk . init ( )
48- . then ( async ( appSdk ) => {
53+ . then ( async ( appSdk : AppSdkProps ) => {
4954 //Adding Track.js metadata
5055 TrackJS . addMetadata ( appSdk ) ;
5156
@@ -108,6 +113,7 @@ const ConfigScreen: React.FC = function () {
108113
109114 const updateCustomJSON = ( e : any ) => {
110115 const val = e ?. target ?. id !== "jsonObject" ;
116+ trackEvent ( "State" , { property : `Update Json` } ) ;
111117 setIsStringified ( val ) ;
112118 updateConfig ( { target : { name : "isStringified" , value : val } } ) ;
113119 } ;
You can’t perform that action at this time.
0 commit comments