📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
set up cookie domain
Blue Mousedc1f23b6e55c
diff --git a/web/.env.example b/web/.env.exampleindex c81b490c3..4854db137 100644--- a/web/.env.example+++ b/web/.env.example@@ -1,6 +1,7 @@API_URL=https://backend.swetrix.com/API_STAGING_URL=http://localhost:5005/CDN_URL=https://cdn.swetrix.com/+COOKIE_DOMAIN=tonomo.swetrix.comDISABLE_MARKETING_PAGES=PADDLE_CLIENT_SIDE_TOKEN=diff --git a/web/app/lib/constants/index.ts b/web/app/lib/constants/index.tsindex 3d6691547..087cc9a26 100644--- a/web/app/lib/constants/index.ts+++ b/web/app/lib/constants/index.ts@@ -385,6 +385,8 @@ const isStaging = isBrowser ? window.REMIX_ENV?.STAGING : process.env.STAGINGconst STAGING_API_URL = isBrowser ? window.REMIX_ENV?.API_STAGING_URL : process.env.API_STAGING_URLconst PRODUCTION_API_URL = isBrowser ? window.REMIX_ENV?.API_URL : process.env.API_URL+export const COOKIE_DOMAIN = (isBrowser ? window.REMIX_ENV?.COOKIE_DOMAIN : process.env.COOKIE_DOMAIN) || 'swetrix.com'+export const isSelfhosted = Boolean(isBrowser ? window.REMIX_ENV?.SELFHOSTED : process.env.__SELFHOSTED)export const isDisableMarketingPages =diff --git a/web/app/root.tsx b/web/app/root.tsxindex d5bc208ad..f485f9f2a 100644--- a/web/app/root.tsx+++ b/web/app/root.tsx@@ -202,6 +202,7 @@ export async function loader({ request }: LoaderFunctionArgs) {STAGING: process.env.STAGING,PADDLE_CLIENT_SIDE_TOKEN: process.env.PADDLE_CLIENT_SIDE_TOKEN,LOCALE: locale,+ COOKIE_DOMAIN: process.env.COOKIE_DOMAIN,}return { locale, url, theme, REMIX_ENV, isAuthed, pathname: urlObject.pathname }diff --git a/web/app/utils/cookie.ts b/web/app/utils/cookie.tsindex 3249f000d..a88de3414 100644--- a/web/app/utils/cookie.ts+++ b/web/app/utils/cookie.ts@@ -1,6 +1,4 @@-import { isDevelopment, isSelfhosted, isBrowser } from '~/lib/constants'--const COOKIE_DOMAIN = 'swetrix.com'+import { isDevelopment, isSelfhosted, isBrowser, COOKIE_DOMAIN } from '~/lib/constants'const COOKIE_SUFFIX = isDevelopment || isSelfhosted ? '' : `; domain=${COOKIE_DOMAIN}; secure`