Skip to main content
Version: 2.0.0-beta.0

๐Ÿ“ฆ plugin-google-gtag

๊ธฐ๋ณธ ์ „์—ญ ์‚ฌ์ดํŠธ ํƒœ๊ทธ(gtag.js) ํ”Œ๋Ÿฌ๊ทธ์ธ์ž…๋‹ˆ๋‹ค. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform, in the production build. ์—ฌ๊ธฐ์—์„œ๋Š” ๊ตฌ๊ธ€ ์• ๋„๋ฆฌํ‹ฑ์Šค๋ฅผ ์œ„ํ•œ ์ „์—ญ ์‚ฌ์ดํŠธ ํƒœ๊ทธ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ธฐ ์œ„ํ•ด ๋„ํ์‚ฌ์šฐ๋ฃจํŠธ ์‚ฌ์ดํŠธ ์„ค์ •์„ ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋Š”์ง€ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

tip

You can use Google's Tag Assistant tool to check if your gtag is set up correctly!

์„ค์น˜#

npm install --save @docusaurus/plugin-google-gtag
tip

@docusaurus/preset-classic์„ ์„ค์น˜ํ•œ ๊ฒฝ์šฐ์—๋Š” ๊ธฐ๋ณธ ํŽ˜์ด์ง€ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๋”ฐ๋กœ ์„ค์น˜ํ•  ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค.

์„ค์ •#

docusaurus.config.js
module.exports = {
plugins: ['@docusaurus/plugin-google-gtag'],
themeConfig: {
gtag: {
// You can also use your "G-" Measurement ID here.
trackingID: 'UA-141789564-1',
// Optional fields.
anonymizeIP: true, // ์ต๋ช… IP๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค๋ฉด
},
},
};