Skip to content

Commit

Permalink
removed posthog identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nizzyabi committed Dec 18, 2024
1 parent 479d6b5 commit b4d0e13
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 172 deletions.
7 changes: 0 additions & 7 deletions packages/features/auth/lib/next-auth-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { updateProfilePhotoGoogle } from "@calcom/app-store/_utils/oauth/updateP
import GoogleCalendarService from "@calcom/app-store/googlecalendar/lib/CalendarService";
import { LicenseKeySingleton } from "@calcom/ee/common/server/LicenseKeyService";
import createUsersAndConnectToOrg from "@calcom/features/ee/dsync/lib/users/createUsersAndConnectToOrg";
import postHogClient from "@calcom/features/ee/event-tracking/lib/posthog/postHogClient";
import ImpersonationProvider from "@calcom/features/ee/impersonation/lib/ImpersonationProvider";
import { getOrgFullOrigin, subdomainSuffix } from "@calcom/features/ee/organizations/lib/orgDomains";
import { clientSecretVerifier, hostedCal, isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml";
Expand Down Expand Up @@ -1041,12 +1040,6 @@ export const getOptions = ({
);
}
}

postHogClient().capture(user.id.toString(), "Sign Up", {
email: user.email,
name: user.name,
username: user.username,
});
}
},
},
Expand Down
40 changes: 0 additions & 40 deletions packages/features/ee/event-tracking/lib/posthog/postHogClient.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function Provider({ children }: { children: React.ReactNode }) {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://us.i.posthog.com",
autocapture: false,
person_profiles: "never",
persistence: "memory",
request_batching: true,
capture_pageview: false,
Expand Down
109 changes: 0 additions & 109 deletions packages/features/ee/event-tracking/lib/posthog/userPostHog.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { MembershipRole, SchedulingType } from "@calcom/prisma/enums";
import { trpc } from "@calcom/trpc/react";
import { Button, Dialog, DialogClose, DialogContent, DialogFooter, showToast } from "@calcom/ui";

import usePostHog from "../../ee/event-tracking/lib/posthog/userPostHog";
import CreateEventTypeForm from "./CreateEventTypeForm";

// this describes the uniform data needed to create a new event type on Profile or Team
Expand Down Expand Up @@ -61,7 +60,6 @@ export default function CreateEventTypeDialog({
membershipRole: MembershipRole | null | undefined;
}[];
}) {
const postHog = usePostHog();
const { t } = useLocale();
const router = useRouter();
const orgBranding = useOrgBranding();
Expand Down Expand Up @@ -130,7 +128,6 @@ export default function CreateEventTypeDialog({
form={form}
isManagedEventType={isManagedEventType}
handleSubmit={(values) => {
postHog.capture("Event Created Frontend");
createMutation.mutate(values);
}}
SubmitButton={SubmitButton}
Expand Down
10 changes: 1 addition & 9 deletions packages/features/shell/Shell.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useSession } from "next-auth/react";
import { usePathname, useRouter } from "next/navigation";
import type { Dispatch, ReactElement, ReactNode, SetStateAction } from "react";
import React, { cloneElement, useEffect } from "react";
import React, { cloneElement } from "react";
import { Toaster } from "react-hot-toast";

import { useRedirectToLoginIfUnauthenticated } from "@calcom/features/auth/lib/hooks/useRedirectToLoginIfUnauthenticated";
Expand All @@ -16,7 +16,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useNotifications } from "@calcom/lib/hooks/useNotifications";
import { Button, ErrorBoundary, HeadSeo, SkeletonText } from "@calcom/ui";

import usePostHog from "../ee/event-tracking/lib/posthog/userPostHog";
import { SideBarContainer } from "./SideBar";
import { TopNavContainer } from "./TopNav";
import { BannerContainer } from "./banners/LayoutBanner";
Expand All @@ -27,19 +26,12 @@ import { useAppTheme } from "./useAppTheme";
const Layout = (props: LayoutProps) => {
const { banners, bannersHeight } = useBanners();
const pathname = usePathname();
const postHog = usePostHog();
const isFullPageWithoutSidebar = pathname?.startsWith("/apps/routing-forms/reporting/");
const pageTitle = typeof props.heading === "string" && !props.title ? props.heading : props.title;
const withoutSeo = props.withoutSeo ?? props.withoutMain ?? false;
useBootIntercom();
useFormbricks();

useEffect(() => {
if (!props.isPublic) {
postHog.identify();
}
}, [props.isPublic, postHog]);

return (
<>
{!withoutSeo && (
Expand Down
4 changes: 0 additions & 4 deletions packages/features/shell/user-dropdown/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
// TODO (Platform): we shouldnt be importing from web here
import { useGetUserAttributes } from "@calcom/web/components/settings/platform/hooks/useGetUserAttributes";

import usePostHog from "../../ee/event-tracking/lib/posthog/userPostHog";
import FreshChatProvider from "../../ee/support/lib/freshchat/FreshChatProvider";

interface UserDropdownProps {
Expand All @@ -32,7 +31,6 @@ export function UserDropdown({ small }: UserDropdownProps) {
const { t } = useLocale();
const { data: user } = useMeQuery();
const pathname = usePathname();
const posthog = usePostHog();
const isPlatformPages = pathname?.startsWith("/settings/platform");
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down Expand Up @@ -207,8 +205,6 @@ export function UserDropdown({ small }: UserDropdownProps) {
StartIcon="log-out"
aria-hidden="true"
onClick={() => {
posthog.capture("sign_out");
posthog.reset();
signOut({ callbackUrl: "/auth/logout" });
}}>
{t("sign_out")}
Expand Down

0 comments on commit b4d0e13

Please sign in to comment.