Skip to content

Commit

Permalink
feat: add google analytics (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebald authored Nov 1, 2023
1 parent e7ac1cb commit b9155e8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/_components/google-analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use client';

import { GoogleAnalytics } from "nextjs-google-analytics";

export const Analytics = () => <GoogleAnalytics trackPageViews />;
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { cn } from '@/lib/utils';
import './globals.css';
import { sans } from './fonts';
import { AnalyticsWrapper } from './_components/analytics';
import { Analytics } from './_components/google-analytics';
import { SiteHeader } from './_components/site-header';
import { SiteFooter } from './_components/site-footer';

Expand Down Expand Up @@ -34,6 +35,7 @@ const Layout = ({ children }: LayoutProps) => (
</Container>
<SiteFooter />
<AnalyticsWrapper />
<Analytics />
</body>
</html>
);
Expand Down
6 changes: 0 additions & 6 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ export const baseUrl =
process.env.NEXT_PUBLIC_APP_URL ??
`https://${process.env.NEXT_PUBLIC_VERCEL_URL}`;

export const dbConfig = {
host: process.env.DATABASE_HOST,
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
};

// Settings
// ---------------
export const pointsUpdateDate = '2023-06-01';
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"kysely": "0.26.3",
"mysql2": "3.6.2",
"next": "14.0.0",
"nextjs-google-analytics": "^2.3.3",
"p-limit": "4.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

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

1 comment on commit b9155e8

@vercel
Copy link

@vercel vercel bot commented on b9155e8 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.