Skip to content

Commit

Permalink
Google Analytics 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
pej4303 committed Aug 26, 2024
1 parent 12f53e5 commit 07667a9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
14 changes: 12 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,19 @@ module.exports = {
},
},
{
resolve: "gatsby-plugin-gtag",
resolve: "gatsby-plugin-google-gtag",
options: {
trackingId: gtag, // 수정: 배열이 필요 없을 수 있습니다.
trackingId: [gtag] , // 수정: 배열이 필요 없을 수 있습니다.
// Google Analytics 관련 설정
gtagConfig: {
anonymize_ip: true, // 사용자 IP 익명화
cookie_expires: 0, // 쿠키 만료 기간 설정
},
// 플러그인 설정
pluginConfig: {
head: true, // true로 설정하면 <head>에 스크립트가 추가됨
respectDNT: true, // Do Not Track를 지원
},
},
},
`gatsby-plugin-sharp`,
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"gatsby": "^5.13.2",
"gatsby-plugin-feed": "^5.13.1",
"gatsby-plugin-fusejs": "^2.0.2",
"gatsby-plugin-google-gtag": "^5.13.1",
"gatsby-plugin-gtag": "^1.0.13",
"gatsby-plugin-image": "^3.13.1",
"gatsby-plugin-manifest": "^5.13.1",
Expand Down

0 comments on commit 07667a9

Please sign in to comment.