Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Google analytics #148

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# SQUID
NEXT_SHIBUYA_GQL_ENDPOINT="http://18.118.77.170:4350/graphql"

NEXT_PUBLIC_GOOGLE_ANALYTICS_ID="G-ID"
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.15",
"@mui/material": "^5.13.5",
"@next/third-parties": "^14.1.2",
"@polkadot/api": "^10.8.1",
"@polkadot/api-contract": "^10.8.1",
"@polkadot/react-identicon": "^3.5.1",
Expand All @@ -35,7 +36,7 @@
"dexie": "^3.2.4",
"fs-extra": "^11.1.1",
"graphql": "^16.8.0",
"next": "13.4.4",
"next": "^14.1.2",
"nprogress": "^0.2.0",
"pg": "^8.11.3",
"react": "18.2.0",
Expand Down Expand Up @@ -68,7 +69,7 @@
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"eslint-config-next": "^14.1.2",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
3 changes: 3 additions & 0 deletions src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ export const IS_DEVELOPMENT =

export const DOCS_URL =
process.env.NEXT_PUBLIC_DOCS_URL || "https://docs.xsigners.io/";

export const ANALYTICS_ID = (process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID ||
"") as string;
4 changes: 4 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { GoogleAnalytics } from "@next/third-parties/google";
import { DocumentProps, Head, Html, Main, NextScript } from "next/document";

import { ANALYTICS_ID } from "@/config/app";

interface MyDocumentProps extends DocumentProps {
emotionStyleTags: JSX.Element[];
}
Expand All @@ -21,6 +24,7 @@ export default function Document({ emotionStyleTags }: MyDocumentProps) {
<Main />
<NextScript />
</body>
{ANALYTICS_ID && <GoogleAnalytics gaId={ANALYTICS_ID} />}
</Html>
);
}
Loading
Loading