From 3df9d067d6c38766cd449fb306dd44397cf1c073 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 2 Nov 2025 21:15:09 +0100 Subject: [PATCH] Clean posthog --- web/lib/service/analytics.ts | 14 +++++++------- web/next.config.js | 35 +++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/web/lib/service/analytics.ts b/web/lib/service/analytics.ts index 4d276d6c..ec5a8b72 100644 --- a/web/lib/service/analytics.ts +++ b/web/lib/service/analytics.ts @@ -27,18 +27,18 @@ export async function track(name: string, properties?: EventIds & EventData) { export function initTracking() { posthog.init(ENV_CONFIG.posthogKey, { - api_host: '/ingest', - ui_host: 'https://us.posthog.com', + api_host: 'https://us.i.posthog.com', + // ui_host: 'https://us.posthog.com', loaded: (posthog) => { posthog.debug(false) }, // Below was a failed attempt to remove that error in the browser console: // Cookie “dmn_chk_01993ec4-8420-79ca-85d3-28fec41426c0” has been rejected for invalid domain. - persistence: 'cookie', - cross_subdomain_cookie: true, // top-level domain cookie - secure_cookie: window.location.protocol === 'https:', - cookie_expiration: 365, - capture_pageview: true, + // persistence: 'cookie', + // cross_subdomain_cookie: true, // top-level domain cookie + // secure_cookie: window.location.protocol === 'https:', + // cookie_expiration: 365, + // capture_pageview: true, }) } diff --git a/web/next.config.js b/web/next.config.js index d4775019..31a13a03 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -23,22 +23,25 @@ module.exports = { experimental: { scrollRestoration: true, }, - rewrites: async () => { - return [ - { - source: '/ingest/static/:path*', - destination: 'https://us-assets.i.posthog.com/static/:path*', - }, - { - source: '/ingest/:path*', - destination: 'https://us.i.posthog.com/:path*', - }, - { - source: '/ingest/decide', - destination: 'https://us.i.posthog.com/decide', - }, - ] - }, + // rewrites: async () => { + // if (isAppBuild) { + // return [] + // } + // return [ + // { + // source: '/ingest/static/:path*', + // destination: 'https://us-assets.i.posthog.com/static/:path*', + // }, + // { + // source: '/ingest/:path*', + // destination: 'https://us.i.posthog.com/:path*', + // }, + // { + // source: '/ingest/decide', + // destination: 'https://us.i.posthog.com/decide', + // }, + // ] + // }, skipTrailingSlashRedirect: true, images: { unoptimized: isAppBuild,