๋ฉ”์ธ ์ปจํ…์ธ ๋กœ ์ด๋™
Version: 2.0.0-beta.15

๐Ÿ“ฆ 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. ์—ฌ๊ธฐ์—์„œ๋Š” ๊ตฌ๊ธ€ ์• ๋„๋ฆฌํ‹ฑ์Šค๋ฅผ ์œ„ํ•œ ์ „์—ญ ์‚ฌ์ดํŠธ ํƒœ๊ทธ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ธฐ ์œ„ํ•ด ๋„ํ์‚ฌ์šฐ๋ฃจํŠธ ์‚ฌ์ดํŠธ ์„ค์ •์„ ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋Š”์ง€ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

tip

์—ฌ๋Ÿฌ๋ถ„์ด ์ž‘์„ฑํ•œ gtag๊ฐ€ ์ ์ ˆํ•˜๊ฒŒ ์„ค์ •๋๋Š”์ง€ ์ฒดํฌํ•˜๊ธฐ ์œ„ํ•ด ๊ตฌ๊ธ€ ํƒœ๊ทธ ์–ด์‹œ์Šคํ„ดํŠธ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

production only

This plugin is always inactive in development and only active in production to avoid polluting the analytics statistics.

์„ค์น˜โ€‹

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

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

You can configure this plugin through the preset options.

์„ค์ •โ€‹

์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ํ•„๋“œ

NameTypeDefaultDescription
trackingIDstringRequiredThe tracking ID of your gtag service.
anonymizeIPbooleanfalse์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ IP๋ฅผ ์ต๋ช…ํ™”ํ• ์ง€ ์—ฌ๋ถ€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์„ค์ • ์˜ˆ์‹œโ€‹

You can configure this plugin through preset options or plugin options.

tip

Most Docusaurus users configure this plugin through the preset options.

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
gtag: {
trackingID: '141789564',
anonymizeIP: true,
},
},
],
],
};