Skip to content

Commit

Permalink
refactor(analytics): make data domain configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
sozonome committed Jun 17, 2022
1 parent ebe7b7c commit 82e3468
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lib/constants/umami.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export const UMAMI_WEBSITE_ID = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID ?? "";
export const UMAMI_SRC = process.env.NEXT_PUBLIC_UMAMI_SRC ?? "";
export const UMAMI_DATA_DOMAIN =
process.env.NEXT_PUBLIC_UMAMI_DATA_DOMAIN ?? "";
8 changes: 6 additions & 2 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { ColorModeScript } from "@chakra-ui/react";
import type { DocumentContext } from "next/document";
import Document, { Html, Head, Main, NextScript } from "next/document";

import { UMAMI_SRC, UMAMI_WEBSITE_ID } from "lib/constants/umami";
import {
UMAMI_DATA_DOMAIN,
UMAMI_SRC,
UMAMI_WEBSITE_ID,
} from "lib/constants/umami";
import customTheme from "lib/styles/theme";

const APP_NAME = "spoker";
Expand Down Expand Up @@ -45,7 +49,7 @@ class MyDocument extends Document {
defer
data-website-id={UMAMI_WEBSITE_ID}
src={UMAMI_SRC}
data-domains="spoker.sznm.dev"
data-domains={UMAMI_DATA_DOMAIN}
/>
</Head>
<body>
Expand Down

0 comments on commit 82e3468

Please sign in to comment.