تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
هذه الصفحة مخصّصة للمطوّرين الذين يريدون تخصيص إعدادات ملفات تعريف الارتباط باستخدام
علامة Google أو أداة "إدارة العلامات من Google". إذا لم تكن متأكّدًا مما إذا كنت بحاجة إلى ضبط إعدادات
ملفات تعريف الارتباط، اطّلِع على ملفات تعريف الارتباط وتحديد هوية المستخدِم.
تستخدِم علامات Google تلقائيًا إعداد نطاق ملفّ تعريف الارتباط التلقائي. يتم ضبط ملفات تعريف الارتباط
على أعلى مستوى ممكن من النطاق. على سبيل المثال، إذا كان عنوان
موقعك الإلكتروني هو blog.example.com، يتم ضبط ملفات تعريف الارتباط على النطاق example.com. إذا
تم رصد أنّك تشغّل خادمًا على الجهاز (على سبيل المثال، localhost)،
سيتم ضبط cookie_domain تلقائيًا على 'none'، وستستخدِم ملفات تعريف الارتباط
النطاق الكامل من الموقع الجغرافي للملفّ.
في معظم المواقع الإلكترونية والتطبيقات، يجب أيضًا التحكّم في تخزين ملفات تعريف الارتباط من خلال موافقة العميل. تقدّم نظرة عامة على خصوصية المستخدم الخيارات المتاحة لإدارة
موافقة المستخدم.
تغيير نطاق ملف تعريف الارتباط
عند استخدام الإعداد التلقائي لنطاق ملفات تعريف الارتباط، يتم قياس النشاط
على مستوى النطاقات الفرعية بدون أيّ إعدادات إضافية.
لإجراء تغييرات على إعدادات نطاق ملفات تعريف الارتباط، اتّبِع الخطوات التالية:
gtag.js
لإيقاف ضبط نطاق ملفّات تعريف الارتباط التلقائي، عدِّل config لعلامتك لتحديد قيمة للمَعلمة cookie_domain:
في أداة "إدارة العلامات من Google"، افتح علامة "رابط الإحالات الناجحة" الحالية أو أنشئ
واحدة إذا لم تكن العلامة متوفّرة بعد في حاويتك.
ضمن خيارات الربط، انقر على تجاوز إعدادات ملفات تعريف الارتباط (خيار متقدم).
في حقل النطاق، أدخِل النطاق الأعلى مستوى الذي يجب السماح بضبط ملف تعريف الارتباط له. يمكنك أيضًا تحديد مسار محدّد
في حقل
المسار. لا تستخدِم هذه الإعدادات إلّا إذا كنت بحاجة إلى حصر ملفات تعريف الارتباط بأحد
النطاقات الفرعية أو الأدلة الفرعية ذات المستوى الأدنى.
إعادة تسمية ملفات تعريف الارتباط
لتجنُّب التعارض مع ملفات تعريف الارتباط الأخرى، قد تحتاج إلى تغيير اسم ملف تعريف الارتباط.
gtag.js
تضيف هذه الإعدادات example إلى بداية ملف تعريف الارتباط الذي يتم ضبطه (على سبيل المثال، _ga يصبح example_ga أو _gcl_au يصبح
example_gcl_au):
في أداة "إدارة العلامات من Google"، افتح علامة "رابط الإحالات الناجحة" الحالية أو أنشئ
علامة إذا لم تكن متوفّرة بعد في حاويتك.
ضمن خيارات الربط، انقر على تجاوز إعدادات ملفات تعريف الارتباط (خيار متقدم).
في الحقل بادئة الاسم، أدخِل بادئة الاسم المطلوبة. يجب أيضًا ضبط أي علامات
تستخدم ملفات تعريف الارتباط هذه (مثل علامات الإحالات الناجحة في "إعلانات Google") لاستخدام البادئة نفسها.
صلاحية ملف تعريف الارتباط
عند كلّ تحميل للصفحة، يتمّ تعديل وقت انتهاء صلاحية ملفّ تعريف الارتباط ليكون الوقت الحالي
بالإضافة إلى قيمة انتهاء صلاحية ملفّ تعريف الارتباط التي تحدّدها علامة Google. وهذا يعني أنّه إذا تم ضبط مدّة انتهاء صلاحية ملفّ تعريف الارتباط على أسبوع واحد (604800 ثانية)، وأجرى أحد المستخدِمين زيارات باستخدام المتصفّح نفسه خلال خمسة أيّام، سيظلّ ملفّ تعريف الارتباط متوفّرًا لمدة أسبوع إضافي، وسيظهر المستخدِم كزائر نفسه في تقاريرك. إذا زار
هذا المستخدِم نفسه الموقع الإلكتروني بعد انتهاء صلاحية ملفّ تعريف الارتباط الأصلي، سيتم إنشاء ملف تعريف
ارتباط جديد، وستظهر زيارته الأولى والثانية على أنّها تأتي
من زوّار مختلفين في تقاريرك.
إذا عيّنتَ قيمة انتهاء صلاحية ملفّ تعريف الارتباط على 0 (صفر) ثوانٍ، يتحوّل ملفّ تعريف الارتباط
إلى ملفّ تعريف ارتباط مستند إلى جلسة وتنتهي صلاحيته بعد انتهاء جلسة المتصفّح الحالية.
gtag.js
gtag('config','TAG_ID',{cookie_expires:28*24*60*60// 28 days, in seconds});
إدارة العلامات
بالنسبة إلى علامة Google:
في مساحة العمل، افتح قائمة العلامات.
عدِّل علامة Google حالية أو أنشئ علامة جديدة.
في إعدادات الضبط، أضِف مَعلمة جديدة:
الاسم: cookie_expires
القيمة: 2419200
احفظ العلامة وانشر الحاوية.
تعديل ملفات تعريف الارتباط
عند ضبط العلامة cookie_update على true (القيمة التلقائية)، قد تعدِّل علامات Google
ملفّات تعريف الارتباط عند كلّ تحميل للصفحة، وقد تعدِّل تاريخ انتهاء صلاحية ملفّ تعريف الارتباط ليكون
مُعدًّا مقارنةً بآخر زيارة إلى الموقع الإلكتروني. على سبيل المثال، إذا تم ضبط انتهاء صلاحية ملفّ تعريف الارتباط على أسبوع واحد، وأجرى أحد المستخدِمين زيارات باستخدام المتصفّح نفسه كلّ
خمسة أيّام، سيتم تعديل تاريخ انتهاء صلاحية ملفّ تعريف الارتباط في كلّ زيارة وبالتالي لن تنتهي صلاحيته أبدًا.
عند الضبط على false، لا يتمّ تعديل ملفّات تعريف الارتباط عند كلّ تحميل للصفحة. ويحدث هذا بسبب انتهاء صلاحية ملفّ تعريف الارتباط بالنسبة إلى أوّل مرّة زار فيها المستخدِم
الموقع الإلكتروني.
تاريخ التعديل الأخير: 2024-11-15 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-11-15 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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."]]