File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const analytics = Analytics({
1515 } ) ,
1616 } ) ,
1717 userpilot ( {
18- token : isDev ( ) ? 'STG-NX-54e88e10' : 'NX-54e88e10' ,
18+ token : 'NX-54e88e10' ,
1919 } ) ,
2020 ] ,
2121 } ) ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export const Track = ({
1919 const { data : userData , isLoading, isSuccess } = useGetUsersMeQuery ( ) ;
2020 const { activeWorkspace } = useActiveWorkspace ( ) ;
2121 const { track, identify, page } = useAnalytics ( ) ;
22+ const utmSource = sessionStorage . getItem ( 'utmSource' ) ;
2223 const location = useLocation ( ) ;
2324
2425 const defaultMeta = [
@@ -63,6 +64,7 @@ export const Track = ({
6364 email : userData . email ,
6465 company : activeWorkspace . company ,
6566 workspace : activeWorkspace ,
67+ ...( ( utmSource && { utm_source : utmSource } ) || { } ) ,
6668 } ) ;
6769
6870 track (
Original file line number Diff line number Diff line change 11import { User } from 'src/features/api' ;
22import { Userpilot } from 'userpilot' ;
3+ import { isDev } from '../isDevEnvironment' ;
34
45declare global {
56 interface Window {
@@ -56,6 +57,9 @@ export default function userpilotPlugin(pluginSettings: UserpilotConfig) {
5657 Userpilot . track ( event , { ...properties , userId } ) ;
5758 } ,
5859
59- loaded : ( ) => ! ! window . userpilot ,
60+ loaded : ( ) => {
61+ const previewEnabled = localStorage . getItem ( 'userpilot_ug_preview' ) ;
62+ return isDev ( ) && previewEnabled !== null ? true : ! ! window . userpilot ;
63+ } ,
6064 } ;
6165}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export function useJoinSubmit(isInvited: boolean) {
1616 const sendGTMevent = useSendGTMevent ( { loggedUser : false } ) ;
1717
1818 const templateParam = searchParams . get ( 'template' ) ;
19+ const utmSource = searchParams . get ( 'utm_source' ) ;
1920 let templateId : number | undefined ;
2021
2122 if ( templateParam !== null ) {
@@ -29,6 +30,10 @@ export function useJoinSubmit(isInvited: boolean) {
2930 templateId = parsed ;
3031 }
3132
33+ if ( utmSource !== null ) {
34+ sessionStorage . setItem ( 'utmSource' , utmSource ) ;
35+ }
36+
3237 const onSubmit = useCallback (
3338 async (
3439 values : JoinFormValues ,
You can’t perform that action at this time.
0 commit comments