mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-23 13:46:45 +02:00
Add frontend hubspot tracker
... but we probably want it to be on the back end. Oh, well.
This commit is contained in:
parent
e27bd74dcc
commit
ed5e74dc07
25
frontend/src/hooks/useHubSpotTracker.ts
Normal file
25
frontend/src/hooks/useHubSpotTracker.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
type FlagEnabledEvent = {
|
||||||
|
email: string;
|
||||||
|
client_id: string;
|
||||||
|
date: Date;
|
||||||
|
project: string;
|
||||||
|
environment_type: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type SdkConnectedEvent = {
|
||||||
|
client_id: string;
|
||||||
|
date: Date;
|
||||||
|
// the same thing we report via the unleash-sdk header, e.g. unleash-client-js:1.0.0
|
||||||
|
sdk: string;
|
||||||
|
app_name: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type HubSpotEvent = FlagEnabledEvent | SdkConnectedEvent;
|
||||||
|
|
||||||
|
export const useHubSpotTracker = () => {
|
||||||
|
const trackEvent = (event: HubSpotEvent) => {
|
||||||
|
// todo: implement
|
||||||
|
};
|
||||||
|
|
||||||
|
return { trackEvent };
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user