From cee3b714545bd57981eec509881227f7750a4904 Mon Sep 17 00:00:00 2001 From: Unchained Date: Tue, 31 Mar 2026 07:19:14 +0200 Subject: [PATCH] fix(analytics): use route handler for OpenPanel script to fix query param issue --- next.config.ts | 4 ---- src/app/[locale]/layout.tsx | 4 ++-- src/app/api/op1/route.ts | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/app/api/op1/route.ts diff --git a/next.config.ts b/next.config.ts index fb95767..a8d2bf3 100644 --- a/next.config.ts +++ b/next.config.ts @@ -34,10 +34,6 @@ const nextConfig: NextConfig = { source: "/api/op/track", destination: `${openpanelUrl}/track`, }, - { - source: "/api/op/op1.js", - destination: `${openpanelScriptUrl}/op1.js`, - }, ]; }, images: { diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 8f2f031..92c7fe6 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -54,8 +54,8 @@ export default async function LocaleLayout({ clientId={process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID || ""} trackScreenViews={true} trackOutgoingLinks={true} - apiUrl="/api/op" - scriptUrl="/api/op/op1.js" + apiUrl="/api/op/track" + scriptUrl="/api/op1" />