@@ -43,6 +43,7 @@ import { useEffect } from "react";
4343import StaticURLConfirmationModal from "./StaticURLConfirmationModal" ;
4444import { debounce } from "lodash" ;
4545import { useDispatch , useSelector } from "react-redux" ;
46+ import AnalyticsUtil from "ee/utils/AnalyticsUtil" ;
4647
4748const APPLICATION_SLUG_REGEX = / ^ [ a - z 0 - 9 - ] + $ / ;
4849const STATIC_URL_DOCS_URL =
@@ -159,9 +160,15 @@ function GeneralSettings() {
159160) ;
160161
161162const openStaticUrlConfirmationModal = useCallback ( ( ) => {
163+ AnalyticsUtil . logEvent ( "STATIC_URL_APPLY_CLICK" , {
164+ applicationId,
165+ oldSlug :application ?. staticUrlSettings ?. uniqueSlug ,
166+ newSlug :applicationSlug ,
167+ } ) ;
168+
162169setModalType ( "change" ) ;
163170setIsStaticUrlConfirmationModalOpen ( true ) ;
164- } , [ ] ) ;
171+ } , [ applicationId , application , applicationSlug ] ) ;
165172
166173const closeStaticUrlConfirmationModal = useCallback ( ( ) => {
167174setIsStaticUrlConfirmationModalOpen ( false ) ;
@@ -178,6 +185,11 @@ function GeneralSettings() {
178185toast . show ( createMessage ( STATIC_URL_CHANGE_SUCCESS ) , {
179186kind :"success" ,
180187} ) ;
188+
189+ AnalyticsUtil . logEvent ( "STATIC_URL_CHANGED" , {
190+ applicationId,
191+ newSlug :applicationSlug ,
192+ } ) ;
181193} ;
182194
183195if (
@@ -198,9 +210,15 @@ function GeneralSettings() {
198210application ?. staticUrlSettings ?. uniqueSlug ,
199211dispatch ,
200212application ?. staticUrlSettings ?. enabled ,
213+ applicationId ,
201214] ) ;
202215
203216const cancelSlugChange = useCallback ( ( ) => {
217+ AnalyticsUtil . logEvent ( "STATIC_URL_CANCEL_CLICK" , {
218+ applicationId,
219+ discardedSlug :applicationSlug ,
220+ } ) ;
221+
204222setApplicationSlug ( application ?. staticUrlSettings ?. uniqueSlug || "" ) ;
205223setIsClientSideSlugValid ( true ) ;
206224dispatch ( resetAppSlugValidation ( ) ) ;
@@ -209,11 +227,21 @@ function GeneralSettings() {
209227if ( ! application ?. staticUrlSettings ?. uniqueSlug ) {
210228setIsStaticUrlToggleEnabled ( false ) ;
211229}
212- } , [ application ?. staticUrlSettings ?. uniqueSlug , dispatch ] ) ;
230+ } , [
231+ application ?. staticUrlSettings ?. uniqueSlug ,
232+ dispatch ,
233+ applicationId ,
234+ applicationSlug ,
235+ ] ) ;
213236
214237const openStaticUrlDocs = useCallback ( ( ) => {
238+ AnalyticsUtil . logEvent ( "STATIC_URL_DOCS_CLICK" , {
239+ source :"general_settings" ,
240+ applicationId,
241+ } ) ;
242+
215243window . open ( STATIC_URL_DOCS_URL , "_blank" ) ;
216- } , [ ] ) ;
244+ } , [ applicationId ] ) ;
217245
218246const updateAppSettings = useCallback (
219247debounce ( ( icon ?:AppIconName ) => {
@@ -336,6 +364,12 @@ function GeneralSettings() {
336364
337365const handleStaticUrlToggle = useCallback (
338366( isEnabled :boolean ) => {
367+ AnalyticsUtil . logEvent ( "STATIC_URL_TOGGLE_CLICK" , {
368+ action :isEnabled ?"enable" :"disable" ,
369+ applicationId,
370+ isCurrentlyEnabled :application ?. staticUrlSettings ?. enabled ,
371+ } ) ;
372+
339373if ( ! isEnabled && isStaticUrlToggleEnabled ) {
340374if ( application ?. staticUrlSettings ?. enabled ) {
341375// Show confirmation modal when disabling
@@ -371,10 +405,16 @@ function GeneralSettings() {
371405toast . show ( createMessage ( STATIC_URL_DISABLED_SUCCESS ) , {
372406kind :"success" ,
373407} ) ;
408+
409+ // Log analytics on successful disable
410+ AnalyticsUtil . logEvent ( "STATIC_URL_DISABLED" , {
411+ applicationId,
412+ previousSlug :application ?. staticUrlSettings ?. uniqueSlug ,
413+ } ) ;
374414} ;
375415
376416dispatch ( disableStaticUrl ( onSuccess ) ) ;
377- } , [ dispatch ] ) ;
417+ } , [ dispatch , applicationId , application ] ) ;
378418
379419const applicationSlugErrorMessage = useMemo ( ( ) => {
380420if ( isFetchingAppSlugSuggestion ) return undefined ;
@@ -468,7 +508,7 @@ function GeneralSettings() {
468508/>
469509</ IconSelectorWrapper >
470510
471- { isStaticUrlFeatureEnabled && (
511+ { true && (
472512< div className = "flex content-center justify-between pt-2" >
473513< Switch
474514className = "mb-0"