Skip to content

Commit

Permalink
Chore: add Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
wadehammes committed Dec 21, 2024
1 parent 1546396 commit 7db32ce
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ module.exports = {
styledComponents: true,
reactRemoveProperties: false,
},
env: {
ENVIRONMENT: process.env.ENVIRONMENT,
GOOGLE_ANALYTICS_KEY: process.env.GOOGLE_ANALYTICS_KEY,
},
webpack(config) {
config.plugins.push(new StylelintPlugin());

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dependencies": {
"@emotion/is-prop-valid": "^1.3.1",
"@jest/types": "^29.6.3",
"@next/third-parties": "^15.1.2",
"@svgr/webpack": "^8.1.0",
"@testing-library/react": "^16.1.0",
"classnames": "^2.5.1",
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import isValidProp from "@emotion/is-prop-valid";
import { GoogleAnalytics } from "@next/third-parties/google";
import { Space_Mono } from "next/font/google";
import StyledComponentsRegistry from "src/lib/registry";
import { CSSRootVariables } from "src/styles/cssVariables";
Expand All @@ -22,11 +23,7 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html
lang="en"
className={spaceMono.className}
style={{ fontFamily: spaceMono.style.fontFamily }}
>
<html lang="en" className={spaceMono.className}>
<body>
<StyledComponentsRegistry>
<CSSRootVariables />
Expand All @@ -35,6 +32,7 @@ export default function RootLayout({
{children}
</StyleSheetManager>
</StyledComponentsRegistry>
<GoogleAnalytics gaId={process.env.GOOGLE_ANALYTICS_KEY as string} />
</body>
</html>
);
Expand Down

0 comments on commit 7db32ce

Please sign in to comment.