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

feat: ✨ analytics update #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
52 changes: 22 additions & 30 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,42 @@ import "@fontsource/roboto-mono/600.css";
import "@fontsource/roboto-mono/700.css";

import { Inter, Roboto } from "next/font/google";
import Script from "next/script";

import { GoogleAnalytics } from "@next/third-parties/google";
import type { Metadata } from "next";
import Navbar from "./components/Navbar";

const GTM_ID = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS;

export const metadata: Metadata = {
title: "Irys Provenance Toolkit",
description: "UI toolkit to kickstart your next projet",
title: "Irys Provenance Toolkit",
description: "UI toolkit to kickstart your next projet",
};

const roboto = Roboto({
weight: "400",
subsets: ["latin"],
display: "swap",
weight: "400",
subsets: ["latin"],
display: "swap",
});

// If loading a variable font, you don't need to specify the font weight
const inter = Inter({
subsets: ["latin"],
display: "swap",
subsets: ["latin"],
display: "swap",
});

export default function RootLayout({ children }: { children: React.ReactNode }) {
const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_ID;

return (
<html lang="en" className={`${roboto.className} bg-background relative`}>
{GTM_ID && (
<Script id="google-tag-manager" strategy="afterInteractive">
{`
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','${GTM_ID}');
`}
</Script>
)}
<body className={roboto.className}>
<Navbar />
{children}
</body>
</html>
);
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" className={`${roboto.className} bg-background relative`}>
{GTM_ID && <GoogleAnalytics gaId={GTM_ID} />}
<body className={roboto.className}>
<Navbar />
{children}
</body>
</html>
);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@irys/query": "^0.0.1",
"@irys/sdk": "^0.0.1",
"@lit-protocol/lit-node-client": "^3.0.2",
"@next/third-parties": "^14.1.0",
"@solana/web3.js": "^1.87.3",
"@types/node": "20.5.6",
"@types/react": "18.2.21",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,13 @@
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.1.tgz#be3dd8b3729ec51c99ff04b51e2b235756d02b6e"
integrity sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==

"@next/third-parties@^14.1.0":
version "14.1.0"
resolved "https://registry.yarnpkg.com/@next/third-parties/-/third-parties-14.1.0.tgz#d9604fff8880e05d3804d2cf7ab42eb5430aec69"
integrity sha512-f55SdvQ1WWxi4mb5QqtYQh5wRzbm1XaeP7s39DPn4ks3re+n9VlFccbMxBRHqkE62zAyIKmvkUB2cByT/gugGA==
dependencies:
third-party-capital "1.0.20"

"@noble/curves@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35"
Expand Down Expand Up @@ -7197,6 +7204,11 @@ thenify-all@^1.0.0:
dependencies:
any-promise "^1.0.0"

[email protected]:
version "1.0.20"
resolved "https://registry.yarnpkg.com/third-party-capital/-/third-party-capital-1.0.20.tgz#e218a929a35bf4d2245da9addb8ab978d2f41685"
integrity sha512-oB7yIimd8SuGptespDAZnNkzIz+NWaJCu2RMsbs4Wmp9zSDUM8Nhi3s2OOcqYuv3mN4hitXc8DVx+LyUmbUDiA==

thread-stream@^0.15.1:
version "0.15.2"
resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-0.15.2.tgz#fb95ad87d2f1e28f07116eb23d85aba3bc0425f4"
Expand Down