Skip to content

Commit b96ff0b

Browse files
committed
Revert "Use Posthog over Vercel analytics (#4389)"
This reverts commit 89c8b0d.
1 parent 89c8b0d commit b96ff0b

File tree

10 files changed

+87
-124
lines changed

10 files changed

+87
-124
lines changed

.github/workflows/build-frontend.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ jobs:
4242
sentry_auth_token=$(aws ssm get-parameter --output text --query Parameter.Value --with-decryption --name /pythonit/${{ inputs.tf_environment }}/common/sentry-auth-token)
4343
echo "::add-mask::$sentry_auth_token"
4444
echo "SENTRY_AUTH_TOKEN=$sentry_auth_token" >> "$GITHUB_OUTPUT"
45-
46-
posthog_key=$(aws ssm get-parameter --output text --query Parameter.Value --with-decryption --name /pythonit/${{ inputs.tf_environment }}/pycon-frontend/posthog-key)
47-
echo "::add-mask::$posthog_key"
48-
echo "POSTHOG_KEY=$posthog_key" >> "$GITHUB_OUTPUT"
4945
- name: Build and push
5046
uses: docker/build-push-action@v6
5147
with:
@@ -66,5 +62,4 @@ jobs:
6662
CONFERENCE_CODE=${{ steps.vars.outputs.conference_code }}
6763
GIT_HASH=${{ inputs.githash }}
6864
secrets: |
69-
sentry_auth_token=${{ steps.vars.outputs.sentry_auth_token }}
70-
posthog_key=${{ steps.vars.outputs.posthog_key }}
65+
"sentry_auth_token=${{ steps.vars.outputs.sentry_auth_token }}"

frontend/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ COPY . .
2626

2727
RUN corepack enable pnpm
2828
RUN --mount=type=secret,id=sentry_auth_token,env=SENTRY_AUTH_TOKEN \
29-
--mount=type=secret,id=posthog_key,env=POSTHOG_KEY \
3029
pnpm run build
3130

3231
FROM base AS runner

frontend/next.config.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const {
1111
CMS_ADMIN_HOST = "admin.pycon.it",
1212
NEXT_PUBLIC_SITE_URL,
1313
SENTRY_AUTH_TOKEN,
14-
POSTHOG_KEY,
1514
} = process.env;
1615

1716
const nextConfig = {
@@ -22,7 +21,6 @@ const nextConfig = {
2221
localeDetection: false,
2322
},
2423
trailingSlash: false,
25-
skipTrailingSlashRedirect: true,
2624
cacheHandler:
2725
process.env.VERCEL_ENV === "preview"
2826
? undefined
@@ -91,14 +89,6 @@ const nextConfig = {
9189
source: "/graphql",
9290
destination: `${API_URL_SERVER}/graphql`,
9391
},
94-
{
95-
source: "/ingest/static/:path*",
96-
destination: "https://eu-assets.i.posthog.com/static/:path*",
97-
},
98-
{
99-
source: "/ingest/:path*",
100-
destination: "https://eu.i.posthog.com/:path*",
101-
},
10292
];
10393

10494
if (API_URL_SERVER.includes("http://backend")) {
@@ -121,7 +111,6 @@ const nextConfig = {
121111
env: {
122112
API_URL: API_URL,
123113
conferenceCode: CONFERENCE_CODE || "pycon-demo",
124-
POSTHOG_KEY: POSTHOG_KEY,
125114
cmsHostname: CMS_HOSTNAME,
126115
NEXT_PUBLIC_SITE_URL: NEXT_PUBLIC_SITE_URL
127116
? `https://${NEXT_PUBLIC_SITE_URL}/`

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"@neshca/cache-handler": "^1.9.0",
2727
"@python-italia/pycon-styleguide": "0.1.210",
2828
"@sentry/nextjs": "^8.45.0",
29+
"@vercel/analytics": "^1.1.1",
2930
"@vercel/og": "^0.6.5",
31+
"@vercel/speed-insights": "^1.0.12",
3032
"@xstate/react": "^3.0.1",
3133
"clsx": "^1.2.1",
3234
"concurrently": "^9.1.0",
@@ -43,7 +45,6 @@
4345
"next": "15.2.0",
4446
"next-cookies": "^2.0.3",
4547
"pdfkit": "^0.15.1",
46-
"posthog-js": "^1.225.0",
4748
"react": "19.0.0",
4849
"react-dnd": "^11.1.3",
4950
"react-dnd-html5-backend": "^11.1.3",

frontend/pnpm-lock.yaml

Lines changed: 57 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/components/add-schedule-to-calendar-modal/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Spacer,
66
Text,
77
} from "@python-italia/pycon-styleguide";
8-
import posthog from "posthog-js";
8+
import va from "@vercel/analytics";
99
import { FormattedMessage } from "react-intl";
1010
import { useCurrentUser } from "~/helpers/use-current-user";
1111
import { useTranslatedMessage } from "~/helpers/use-translated-message";
@@ -38,7 +38,7 @@ export const AddScheduleToCalendarModal = ({ onClose }: Props) => {
3838
const autoSelectInput = (e: React.MouseEvent<HTMLInputElement>) => {
3939
(e.target as HTMLInputElement).select();
4040
document.execCommand("copy");
41-
posthog.capture("copy-calendar-url");
41+
va.track("copy-calendar-url");
4242
};
4343

4444
const pleaseWaitMessage = useTranslatedMessage("login.loading");

frontend/src/components/schedule-view/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {
66
Spacer,
77
Text,
88
} from "@python-italia/pycon-styleguide";
9-
import posthog from "posthog-js";
10-
9+
import va from "@vercel/analytics";
1110
import { isAfter, isBefore, parseISO } from "date-fns";
1211
import { fromZonedTime } from "date-fns-tz";
1312
import React, {
@@ -145,7 +144,7 @@ export const ScheduleView = ({
145144
setViewMode((current) => {
146145
const nextValue = current === "grid" ? "list" : "grid";
147146
prevViewMode.current = nextValue;
148-
posthog.capture("schedule-view", { view: nextValue });
147+
va.track("schedule-view", { view: nextValue });
149148
return nextValue;
150149
});
151150
}, []);

frontend/src/middleware.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export async function middleware(req: NextRequest) {
3131
!PUBLIC_FILE.test(req.nextUrl.pathname) &&
3232
!req.nextUrl.pathname.includes("/api/") &&
3333
!req.nextUrl.pathname.includes("/admin") &&
34-
!req.nextUrl.pathname.includes("/ingest") &&
3534
!req.nextUrl.pathname.includes("/local_files_upload") &&
3635
!req.nextUrl.pathname.includes("/media") &&
3736
!req.nextUrl.pathname.includes("/graphql") &&

0 commit comments

Comments
 (0)