Skip to content

Commit

Permalink
google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-ramesh committed Sep 24, 2023
1 parent 653f114 commit 5e25c63
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apps/docs/theme.config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { DocsThemeConfig, Tabs } from "nextra-theme-docs";
import Link from "next/link";
import Script from "next/script";

const config: DocsThemeConfig = {
useNextSeoProps() {
Expand All @@ -15,6 +16,24 @@ const config: DocsThemeConfig = {
},
docsRepositoryBase:
"https://github.com/abhay-ramesh/next-s3-uploader/tree/main/apps/docs",
head: (
<>
{process.env.NODE_ENV === "production" && (
<>
<Script src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID" />
<Script id="google-analytics">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-0VVF3E9SJ9');
`}
</Script>
</>
)}
</>
),
footer: {
text: (
<>
Expand Down

0 comments on commit 5e25c63

Please sign in to comment.