이 페이지는 Google 태그 또는 Google 태그 관리자를 사용하여 쿠키 설정을 맞춤설정하려는 개발자를 대상으로 합니다. 쿠키 설정을 맞춤설정해야 하는지 확실하지 않으면 쿠키 및 사용자 식별을 참고하세요.
기본적으로 Google 태그에서는 자동 쿠키 도메인 구성이 사용됩니다. 쿠키는 가능한 최상위 수준에서 설정됩니다. 예를 들어 웹사이트 주소가 blog.example.com이면 쿠키가 example.com 도메인에 설정됩니다. 서버가 로컬에서 실행되고 있다고 감지되면(예: localhost), cookie_domain이 자동으로 'none'으로 설정되고 쿠키가 문서 위치의 전체 도메인을 사용합니다.
쿠키 만료 또는 쿠키 업데이트 설정만 수정하려면 애널리틱스 인터페이스를 사용하여 기본 쿠키 설정을 변경하세요.
대부분의 웹사이트와 앱의 경우 쿠키 저장소도 사용자 동의에 의해
관리되어야 합니다. 사용자 개인 정보 보호 개요에는 사용자 동의를 관리하는 데 사용할 수 있는 옵션이 도입되었습니다.
쿠키 도메인 변경
자동 쿠키 도메인 구성을 사용하면 추가 구성 없이도 하위 도메인에서 활동이 측정됩니다.
쿠키 도메인 구성을 변경하려면 다음 단계를 따르세요.
gtag.js
자동 쿠키 도메인 구성을 사용 중지하려면 태그의 config를 업데이트하여
cookie_domain 매개변수 값을 지정합니다.
1. In Tag Manager, open your existing Conversion Linker tag, or create
one if the tag doesn't yet exist in your container.
링커 옵션에서 쿠키 설정 재정의(고급)를 클릭합니다.
이름 접두사 필드에 원하는 이름 접두사를 입력합니다. 이러한 쿠키를 사용하는 모든 태그(예: Google Ads 전환 태그)도 같은 접두사를 사용하도록 구성되어야 합니다.
쿠키 만료
페이지를 로드할 때마다 쿠키 만료 시간이 현재 시간 및 Google 태그에 의해 설정된 쿠키 만료 시간 값으로 업데이트됩니다. 즉, 쿠키 만료를 1주(604800초)로 설정했고 사용자가 5일 이내에 동일한 브라우저를 사용해 방문하면 쿠키를 1주일 더 사용할 수 있으며 사용자는 보고서에 동일한 방문자로 표시됩니다. 같은 사용자가 원래 쿠키가 만료된 후에 방문했다면 새 쿠키가 생성되며, 이 사용자의 첫 번째 및 두 번째 방문은 보고서에 순 방문자로 표시됩니다.
쿠키 만료 값을 0(영)초로 설정하면 쿠키가
세션 기반 쿠키로 전환되며 현재 브라우저 세션이 종료되면 만료됩니다.
값에 쿠키가 만료되기 전의 시간(초)을 입력합니다.
예를 들어 28일의 경우 2419200을 입력합니다.
태그를 저장하고 컨테이너를 게시합니다.
쿠키 업데이트
cookie_update 플래그를 true(기본값)로 설정하면 페이지 로드 시 Google 태그가 쿠키를 업데이트할 수 있으며, 최근 사이트 방문을 기준으로 설정하도록 쿠키 만료 기간을 업데이트할 수 있습니다. 예를 들어 쿠키 만료 기간이 1주일로 설정되어 있고 사용자가 5일마다 동일한 브라우저를 사용하는 경우, 쿠키 만료 기간이 방문할 때마다 업데이트되므로 실질적으로는 만료되지 않습니다.
false로 설정할 경우 페이지 로드 시 쿠키가 업데이트되지 않습니다. 이는
사용자가 사이트를 처음 방문했을 때의 시점을 기준으로 쿠키가 만료되는 것과 같은 효과를
갖습니다.
[null,null,["최종 업데이트: 2024-04-17(UTC)"],[[["\u003cp\u003eThis guide helps developers customize cookie settings for Google tag and Google Tag Manager to control data collection and user privacy.\u003c/p\u003e\n"],["\u003cp\u003eBy default, Google tags automatically set cookies on the highest possible domain; this can be customized to specific domains or subdomains if needed.\u003c/p\u003e\n"],["\u003cp\u003eCookie names can be modified to avoid conflicts, but changing them after initial visits may result in existing users appearing as new visitors.\u003c/p\u003e\n"],["\u003cp\u003eCookie expiration can be adjusted, with a value of 0 creating a session-based cookie that expires when the browser session ends.\u003c/p\u003e\n"],["\u003cp\u003eCookie update settings determine if cookies are updated on each page load, impacting how user visits are tracked over time.\u003c/p\u003e\n"]]],["Developers can customize Google tag cookie settings via `gtag.js` or Tag Manager. Actions include: adjusting the `cookie_domain` to specify where cookies are set, setting a `cookie_prefix` to rename cookies and avoid conflicts, modifying `cookie_expires` to control cookie duration (session-based or set time), and setting `cookie_update` to determine if cookies refresh on each visit. For Google Ads and Floodlight tags, domain and name prefix settings can be changed in the Conversion Linker tag.\n"],null,["# Configure and customize cookies\n\n\u003e This page is for developers that want to customize cookie settings with the\n\u003e Google tag or Google Tag Manager. If you aren't sure if you need to configure\n\u003e cookies, read [Cookies and user identification](/tag-platform/security/concepts/cookies).\n\nBy default, Google tags use automatic cookie domain configuration. Cookies are\nset on the highest level of domain possible. For example, if your website\naddress is `blog.example.com`, cookies are set on the `example.com` domain. If\nit is detected that you're running a server locally (for example, `localhost`),\n`cookie_domain` is automatically set to `'none'`, and cookies will use the full\ndomain from the document location.\n\nIf you only want to modify cookie expiration or cookie update settings, you can\n[change default cookie settings](https://support.google.com/analytics/answer/11397207#cookie-override) using the Analytics interface.\n\nFor most websites and apps, cookie storage should also be controlled by user\nconsent. [User privacy overview](/tag-platform/security/concepts/privacy) introduces the available options for managing\nuser consent.\n| **Note:** If you use the Google tag and have multiple products on a page that share cookies, use `gtag('set')` commands instead of `gtag('config')` for your cookie configuration settings. Doing so gives you more consistent results.\n\nChange cookie domain\n--------------------\n\n| **Important:** The `cookie_domain` value must be an ancestor of the current domain, otherwise the cookie will not be set. For example, if your domain is `one.two.three.root.com`, you may configure the cookie to be set on `root.com`, but not `someotherdomain.com`. Setting an incorrect cookie domain may result in no data being sent.\n\nWhen you use automatic cookie domain configuration, activity is\nmeasured across subdomains without any extra configuration.\n\nTo make changes to the cookie domain configuration, follow these steps: \n\n### gtag.js\n\nTo turn off automatic cookie domain configuration, update the `config` for\nyour tag to specify a value for the `cookie_domain` parameter: \n\n gtag('config', 'TAG_ID', {\n 'cookie_domain': 'blog.example.com'\n });\n\n### Tag Manager\n\n### For the **Google tag**:\n\n1. In your workspace, open the **Tags** menu.\n2. Edit an existing **Google tag** or create a new one.\n3. In the **Configuration** settings, add a new parameter:\n\n - **Name** : `cookie_domain`\n - **Value** : `my.example.com`\n4. **Save** the tag and publish the container.\n\n### For **Google Ads** and **Floodlight** tags:\n\nDomain settings can be modified from the [Conversion Linker](https://support.google.com/tagmanager/answer/7549390) tag:\n\n1. In Tag Manager, open your existing Conversion Linker tag, or create one if the tag doesn't yet exist in your container.\n2. Under **Linker Options** , click **Override cookie settings (advanced)**\n3. In the **Domain** field, enter the highest level domain for which a cookie should be allowed to be set. You can also specify a specific path in the **Path** field. Only use these settings if you need to limit cookies to a lower-level subdomain or subdirectory.\n\nRename cookies\n--------------\n\nTo avoid conflicts with other cookies, you may need to change the cookie name.\n**Important:** If the cookie name settings change after users have first visited your site, those visitors will appear as new visitors because the context stored in the non-modified cookies will be lost. \n\n### gtag.js\n\nThis configuration adds `example` to the beginning of the cookie that it\nsets (for example `_ga` becomes `example_ga`, or `_gcl_au` becomes\n`example_gcl_au`): \n\n gtag('config', 'TAG_ID', {\n cookie_prefix: 'example'\n });\n\n### Tag Manager\n\n### For the **Google tag**:\n\n1. In your workspace, open the **Tags** menu.\n2. Edit an existing **Google tag** or create a new one.\n3. In the **Configuration** settings, add a new parameter:\n\n - **Name** : `cookie_prefix`\n - **Value** : `example`\n4. **Save** the tag and publish the container.\n\n### For **Google Ads** and **Floodlight** tags:\n\nName prefix settings can be modified from the [Conversion Linker](https://support.google.com/tagmanager/answer/7549390) tag:\n\n1. In Tag Manager, open your existing Conversion Linker tag, or create one if the tag doesn't yet exist in your container.\n2. Under **Linker Options** , click **Override cookie settings (advanced)**\n3. In the **Name prefix** field, enter the desired name prefix. Any tags that use these cookies (for example, Google Ads conversion tags) must also be configured to use the same prefix.\n\nCookie expiration\n-----------------\n\nOn each page load, the cookie expiration time is updated to be the current time\nplus the cookie expiration value set by the Google tag. This means that if\ncookie expiration is set to one week (`604800` seconds), and a user visits using\nthe same browser within five days, the cookie will be available for an\nadditional week, and they will appear as the same visitor in your reports. If\nthat same user instead visited after the original cookie had expired, a new\ncookie will be created, and their first and second visits will appear as coming\nfrom distinct visitors in your reports.\n\nIf you set the cookie expiration value to `0` (zero) seconds, the cookie turns\ninto a [session based cookie](http://en.wikipedia.org/wiki/HTTP_cookie#Session_cookie) and expires once the current browser session ends. \n\n### gtag.js\n\n gtag('config', 'TAG_ID', {\n cookie_expires: 28 * 24 * 60 * 60 // 28 days, in seconds\n });\n\n### Tag Manager\n\n### For the **Google tag**:\n\n1. In your workspace, open the **Tags** menu.\n2. Edit an existing **Google tag** or create a new one.\n3. In the **Configuration** settings, add a new parameter:\n\n - **Name** : `cookie_expires`\n - **Value** : `2419200`\n\n | **Note:** A value of `2419200` equals 28 days but you can set any duration you need.\n4. **Save** the tag and publish the container.\n\n| **Note:** **Google Ads** and **Floodlight** cookies set by the [Conversion\n| Linker](https://support.google.com/tagmanager/answer/7549390) tag don't support `cookie_expires` at this time. If support for `cookie_expires` is required, use gtag.js for this tag configuration.\n\nCookie update\n-------------\n\nWhen the `cookie_update` flag is set to `true` (the default value), Google tags\nmay update cookies on each page load, and may update the cookie expiration to be\nset relative to the most recent visit to the site. For example, if cookie\nexpiration is set to one week, and a user visits using the same browser every\nfive days, the cookie expiration will be updated on each visit and so will\neffectively never expire.\n\nWhen set to `false`, cookies are not updated on each page load. This has the\neffect of cookie expiration being relative to the first time a user visited the\nsite. \n\n### gtag.js\n\n gtag('config', 'TAG_ID', {\n cookie_update: false\n });\n\n### Tag Manager\n\n### For the **Google tag**:\n\n1. In your workspace, open the **Tags** menu.\n2. Edit an existing **Google tag** or create a new one.\n3. In the **Configuration** settings, add a new parameter:\n\n - **Name** : `cookie_update`\n - **Value** : `false`\n4. **Save** the tag and publish the container.\n\n | **Note:** **Google Ads** and **Floodlight** cookies set by the [Conversion\n | Linker](https://support.google.com/tagmanager/answer/7549390) tag don't support `cookie_update` at this time. If support for `cookie_update` is required, use gtag.js for this tag configuration."]]