-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix new source / destination test connection success / failure tracki…
…ng events (#12526) * Consolidate track new action analytics calls into hook * Move new source and destination test tracking to where the actual connection is being tested and remove from creation * Use consistent properties across all track new source actions * Make track action hook more generic and support new destination actions Update new destination actions with useTrackAction hook * Use connector_source_definition_id over connector_source_id for track new source actions
- Loading branch information
Showing
9 changed files
with
75 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useCallback } from "react"; | ||
|
||
import { useAnalyticsService } from "./services/Analytics/useAnalyticsService"; | ||
|
||
export const enum TrackActionType { | ||
NEW_SOURCE = "New Source", | ||
NEW_DESTINATION = "New Destination", | ||
} | ||
|
||
interface TrackActionProperties { | ||
connector_source?: string; | ||
connector_source_definition_id?: string; | ||
connector_destination?: string; | ||
connector_destination_definition_id?: string; | ||
} | ||
|
||
export const useTrackAction = (type: TrackActionType) => { | ||
const analyticsService = useAnalyticsService(); | ||
|
||
return useCallback( | ||
(action: string, properties: TrackActionProperties) => { | ||
analyticsService.track(`${type} - Action`, { action, ...properties }); | ||
}, | ||
[analyticsService, type] | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters