Skip to content

Commit 0853f98

Browse files
committed
feat: add google analytics
1 parent 4559d80 commit 0853f98

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
2121
"dependencies": {
22+
"@next/third-parties": "^14.2.5",
2223
"next": "^13.0.6",
2324
"next-sitemap": "^4.2.3",
2425
"nextra": "latest",

pnpm-lock.yaml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

theme.config.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { DocsThemeConfig, useConfig } from "nextra-theme-docs";
33
import { useRouter } from "next/router";
4+
import { GoogleAnalytics } from '@next/third-parties/google'
45

56
const config: DocsThemeConfig = {
67
head: () => {
@@ -11,6 +12,7 @@ const config: DocsThemeConfig = {
1112

1213
return (
1314
<>
15+
<GoogleAnalytics gaId="G-XV58K6R2PX" />
1416
<link rel="icon" type="image/png" href="/logo.png" />
1517

1618
<meta httpEquiv="Content-Language" content="en" />

0 commit comments

Comments
 (0)