Skip to content

Commit

Permalink
integrate google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmooot committed Oct 20, 2024
1 parent 6a467cc commit 5e06d1a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID = 'G-H0BM7VB4LE'
2 changes: 2 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
env:
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID: ${{ secrets.GTAG_ID }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Layout } from '@/components/dom/common/Layout'
import '@/global.css'
import '@/components/dom/common/Carousel/embla.css'
import Head from './head'
import { GoogleAnalytics } from '@next/third-parties/google'

export const metadata = {
title: 'DUSTIN SMOOTE',
Expand All @@ -21,6 +22,7 @@ export default function RootLayout({ children }) {
{/* To avoid FOUT with styled-components wrap Layout with StyledComponentsRegistry https://beta.nextjs.org/docs/styling/css-in-js#styled-components */}
<Layout>{children}</Layout>
</body>
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID} />
</html>
)
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@14islands/r3f-scroll-rig": "^8.13.1",
"@ducanh2912/next-pwa": "^10.0.0",
"@gsap/react": "^2.1.1",
"@next/third-parties": "^14.2.15",
"@react-three/drei": "^9.92.7",
"@react-three/fiber": "^8.15.12",
"@studio-freight/lenis": "^1.0.42",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,13 @@
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.15.tgz#18d68697002b282006771f8d92d79ade9efd35c4"
integrity sha512-SzqGbsLsP9OwKNUG9nekShTwhj6JSB9ZLMWQ8g1gG6hdE5gQLncbnbymrwy2yVmH9nikSLYRYxYMFu78Ggp7/g==

"@next/third-parties@^14.2.15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/third-parties/-/third-parties-14.2.15.tgz#becb2cf4f1ae2f451051923e406107cf57b28c59"
integrity sha512-15CvipE1p1GtlzVfbDfXPrAGIhzJJe75Yy6+GIBRTd36lu95BegRsUJwCxJYoKz47Q09stcU2gJDMduMGqrikw==
dependencies:
third-party-capital "1.0.20"

"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
Expand Down Expand Up @@ -5637,6 +5644,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==

three-mesh-bvh@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/three-mesh-bvh/-/three-mesh-bvh-0.7.8.tgz#83156e4d3945734db076de1c94809331481b3fdd"
Expand Down

0 comments on commit 5e06d1a

Please sign in to comment.