Skip to content

Commit 818638d

Browse files
Merge pull request eduardconstantin#109 from eduardconstantin/feat/update-ga
Replace ga
2 parents f1e3642 + aaab10c commit 818638d

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

app/layout.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { type ReactNode } from "react";
2+
import { type Metadata } from "next";
13
import TopNav from "@azure-fundamentals/components/TopNav";
24
import Footer from "../components/Footer";
3-
import { ReactNode } from "react";
4-
import { Metadata } from "next";
5-
import "styles/globals.css";
6-
import Script from "next/script";
75
import ApolloProvider from "@azure-fundamentals/components/ApolloProvider";
6+
import { GoogleAnalytics, GoogleTagManager } from "@next/third-parties/google";
7+
import "styles/globals.css";
88

99
export const metadata: Metadata = {
1010
metadataBase: new URL("http://localhost:3000"),
@@ -30,7 +30,9 @@ export default function RootLayout({ children }: RootLayoutProps) {
3030
{children}
3131
<Footer />
3232
</main>
33-
<Script
33+
<GoogleTagManager gtmId={GA_TRACKING_ID!} />
34+
<GoogleAnalytics gaId={GA_TRACKING_ID!} />
35+
{/*<Script
3436
src={
3537
"https://www.googletagmanager.com/gtag/js?id=" + GA_TRACKING_ID
3638
}
@@ -45,7 +47,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
4547
page_path: window.location.pathname,
4648
});
4749
`}
48-
</Script>
50+
</Script>*/}
4951
</ApolloProvider>
5052
</body>
5153
</html>

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@apollo/client": "^3.7.9",
1919
"@as-integrations/next": "^3.0.0",
2020
"@azure/cosmos": "^3.17.2",
21+
"@next/third-parties": "^14.1.3",
2122
"@types/node": "18.13.0",
2223
"@types/react": "^18.2.42",
2324
"@types/react-dom": "^18.2.17",

0 commit comments

Comments
 (0)