diff --git a/apps/www/next.config.js b/apps/www/next.config.js index 0293ae3..807e51e 100644 --- a/apps/www/next.config.js +++ b/apps/www/next.config.js @@ -45,6 +45,22 @@ const nextConfig = { }, ]; }, + async rewrites() { + 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", + }, + ]; + }, eslint: { ignoreDuringBuilds: true, }, diff --git a/apps/www/package.json b/apps/www/package.json index ef5d865..fab9e21 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -56,6 +56,7 @@ "nextjs-toploader": "^1.6.12", "nprogress": "^0.2.0", "postcss-obfuscator": "^1.6.1", + "posthog-js": "^1.230.2", "prettier": "^3.3.1", "react": "^19.0.0", "react-dom": "^19.0.0", diff --git a/apps/www/src/app/(main)/layout.tsx b/apps/www/src/app/(main)/layout.tsx index a2a5242..970e2c1 100644 --- a/apps/www/src/app/(main)/layout.tsx +++ b/apps/www/src/app/(main)/layout.tsx @@ -26,7 +26,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import { Analytics } from "@vercel/analytics/react"; import { SpeedInsights } from "@vercel/speed-insights/next"; import { GeistSans } from "geist/font/sans"; import "../globals.css"; @@ -41,6 +40,7 @@ import { Inter as interFont } from "next/font/google"; import LayoutPart from "@/components/feat/LayoutPart"; import AllBanners from "@/components/feat/AllBanners"; import Footer from "@/components/misc/Footer"; +import { PostHogProvider } from "@/components/misc/PosthogProvider"; export const viewport: Viewport = { themeColor: "black", @@ -57,14 +57,15 @@ export default async function RootLayout({ - - {children} - - - - - -