Skip to content

Commit

Permalink
GA Vercel 환경변수로
Browse files Browse the repository at this point in the history
  • Loading branch information
hanmilLee committed May 12, 2022
1 parent 5e6cd41 commit 9c6e083
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/PageHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export const PageHead: React.FC<
<meta property='og:type' content='website' />
<script
async
src={`https://www.googletagmanager.com/gtag/js?id=G-Z5BHM2E3ZG`}
src={`https://www.googletagmanager.com/gtag/js?id=${config.GAId}`}
/>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Z5BHM2E3ZG', {
gtag('config', ${config.GAId}, {
page_path: window.location.pathname,
});
`
Expand Down
1 change: 1 addition & 0 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export const site: Site = {
rootNotionSpaceId,
description
}
export const GAId = isDev ? null : process.env.NEXT_PUBLIC_GA_ID

export const fathomId = isDev ? null : process.env.NEXT_PUBLIC_FATHOM_ID
export const fathomConfig = fathomId
Expand Down

1 comment on commit 9c6e083

@vercel
Copy link

@vercel vercel bot commented on 9c6e083 May 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextjs-notion-starter-kit – ./

hmdev.vercel.app
nextjs-notion-starter-kit-hanmillee.vercel.app
nextjs-notion-starter-kit-git-main-hanmillee.vercel.app

Please sign in to comment.