راهنمای سبک قالب
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این راهنمای سبک برای کمک به شما در تصمیم گیری در مورد نحوه تهیه الگوها برای گالری الگوهای انجمن تهیه شده است. این راهنمای سبک بر اساس اصول نوشتن Google Material Design است. به بیان ساده، این موارد عبارتند از:
- مختصر باشد
- ساده و مستقیم بنویسید
- کاربران را به وضوح نشان دهید
- جزئیات ضروری را به اشتراک بگذارید
- برای تمام سطوح خواندن بنویسید
- انسان باش: برای انسان ها بنویس، نه روبات ها
این دستورالعملها را دنبال کنید تا اطمینان حاصل کنید که همه الگوها ظاهر و احساسی ثابت دارند و به کاربران کمک میکند نحوه استفاده از الگوی شما را درک کنند.
اطلاعات
این دستورالعمل ها در مورد مواردی که در برگه اطلاعات ویرایشگر الگو یافت می شوند اعمال می شود.
نام
نام الگو در سراسر رابط کاربری Tag Manager و گالری الگوی انجمن به کاربران Tag Manager ارائه می شود. در بالای صفحه جزئیات یک الگو ظاهر می شود و زمانی که الگوها فهرست می شوند ظاهر می شود.
- از نام شرکت/سازمان خود و نام کاربردی الگو استفاده کنید: نام سازمان نام الگو .
- از Title Case استفاده کنید.
- از عباراتی استفاده کنید که توصیف کننده عملکرد هستند.
- از استفاده از عبارت "رسمی" در نام الگوها خودداری کنید، مگر اینکه از طرف سازمان مربوطه مجوز این کار را داشته باشید.
مثالها: برچسب اندازهگیری تبدیل MyCompany، متغیر ID کمپین MyCompany
توضیحات
توضیحات قالب شرحی از الگو است که در صفحات جزئیات به عنوان خلاصه ای از عملکرد الگو ظاهر می شود.
- از جملات واضح و مختصر برای توصیف کارهایی که الگو انجام می دهد استفاده کنید.
- به وضوح بیان کنید که الگوی شما چه سودی برای کاربر دارد. به عنوان مثال: "الگوی Example.com Audience Builder می تواند به شما در ایجاد لیست مخاطبان جدید از بازدیدکنندگان وب سایت کمک کند."
- از اصطلاحات خاص خودداری کنید.
- پیوندهایی برای اطلاعات بیشتر، اسناد و پشتیبانی اضافه کنید.
نماد
نماد الگوی شما وقتی در Tag Manager و در گالری الگوی انجمن فهرست میشود، بهعنوان یک تصویر کوچک نشان داده میشود.
- برای فرمت تصویر از PNG، JPEG یا GIF استفاده کنید.
- تصویر باید مربع باشد، حداقل 48 پیکسل در 48 پیکسل، و بزرگتر از 96 پیکسل در 96 پیکسل نباشد.
- حجم فایل باید کمتر از 50 کیلوبایت باشد.
- از استفاده از آرم های رسمی شرکت خودداری کنید، مگر اینکه از طرف سازمان مربوطه مجوز این کار را داشته باشید.
- فیلدها
- از برگه فیلدهای ویرایشگر الگو برای افزودن عناصر فرم مانند ورودی متن، چک باکس ها و غیره استفاده کنید.
فیلدها
این دستورالعملهای سبک برای برگههای ویرایشگر الگو اعمال میشود.
نام پارامتر
این نام فیلد است که در ویرایشگر الگو ظاهر می شود، اما نه آنطور که برای کاربر ظاهر می شود. نام ها باید توصیفی از نوع داده های مورد استفاده باشد. نام پارامترها را به صورت lowerCamelCase
قالب بندی کنید. مثال: نام کاربری، شناسه مشتری، shoppingCartValue .
برچسب های زمینه
برچسب های فیلد شامل فیلدهای نام نمایشی، متن چک باکس و موارد مرتبط است.
- از حالت جمله استفاده کنید
- کوتاهتر بهتر است
- توصیفی باشد.
- از کلمات رایج استفاده کنید.
متن راهنما
متن راهنما یک محتوای اطلاعاتی است که به عنوان یک راهنمای ابزار نشان داده شده است تا به کاربر کمک کند مقدار معتبری را در قسمت الگو وارد کند. در صورت امکان، ورودی نمونه ارائه دهید و نحوه استفاده از فیلد الگو یا تأثیر ارائه مقادیر خاص را شرح دهید.
- از حالت جمله استفاده کنید
- مختصر باشید، اما انسان باشید. اشکالی ندارد از انقباضات استفاده کنید و به صورت دوم شخص (شما) بنویسید.
- انواع فیلدهای پشتیبانی شده
- قالب بندی اولیه HTML مجاز است. مثالها:
<strong>
، <em>
.
انواع فیلدهای پشتیبانی شده
تایپ کنید | توضیحات |
---|
ورودی متن | ورودی متن مقدار یک پارامتر الگو از این نوع رشته ای خواهد بود که ممکن است به متغیرها اشاره کند. ویجت ورودی متن ارائه شده در رابط کاربری Tag Manager می تواند یک فیلد متنی تک خطی یا یک ورودی چند خطی باشد. |
منوی کشویی | منوی کشویی که در آن فقط یک مورد می تواند به عنوان مقدار پارامتر الگو انتخاب شود. موارد را به ترتیب حروف الفبا فهرست کنید مگر اینکه دلیل خوبی برای انجام این کار وجود داشته باشد. |
چک باکس | ورودی چک باکس مقدار یک پارامتر الگو از این نوع خواهد بود بولی: درست برای علامت زده شده، غلط برای علامت نشده است. |
دکمه رادیویی | ورودی رادیو یک پارامتر الگو از این نوع لیستی از انتخاب ها را در رابط کاربری Tag Manager ارائه می دهد و کاربر فقط مجاز است یکی از گزینه ها را به عنوان مقدار پارامتر الگو انتخاب کند. |
میز ساده | ورودی جدول ساده هر سلول در جدول را می توان در جای خود ویرایش کرد و هر سلول فقط می تواند دو نوع باشد: یک ورودی متن یا یک منوی کشویی. مقدار پارامتر الگو از این نوع آرایه ای از اشیاء است: هر شی یک ردیف را رمزگذاری می کند، هر کلید در شی باید یکی از نام ستون ها باشد و هر مقدار در شی مقدار سلول مربوطه است. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis style guide helps you create templates for the Community Template Gallery, ensuring consistency and user-friendliness by adhering to Google Material Design writing principles.\u003c/p\u003e\n"],["\u003cp\u003eWhen naming your template, use your organization's name, a descriptive functional name in Title Case, and avoid using "Official" unless authorized.\u003c/p\u003e\n"],["\u003cp\u003eTemplate descriptions should clearly explain the template's function, benefits, and any supporting resources using concise language and avoiding jargon.\u003c/p\u003e\n"],["\u003cp\u003eTemplate icons must be square images (PNG, JPEG, or GIF) between 48px and 96px in size, under 50 kilobytes, and avoid using official logos without authorization.\u003c/p\u003e\n"],["\u003cp\u003eFor template fields, use descriptive parameter names in lowerCamelCase, concise and clear field labels in sentence case, and helpful tooltips written in a human-friendly tone.\u003c/p\u003e\n"]]],["Template guidelines for the Community Template Gallery include creating descriptive names using \"Organization Name Template Name\" in Title Case, clear descriptions detailing template functionality and user benefits, and square icons (48-96px, under 50KB). In the Fields tab, parameter names should be `lowerCamelCase`, field labels in sentence case, and concise, human-readable help text. Supported field types are text input, drop-down menu, checkbox, radio button, and simple table, with specific formatting rules.\n"],null,["# Template style guide\n\nThis style guide has been prepared to help you make decisions on how to prepare templates for the [Community Template Gallery](https://support.google.com/tagmanager/answer/9454109). This style guide is based on the [Google Material Design writing principles](https://material.io/design/communication/writing.html#principles). Simply put, these are:\n\n- Be concise\n- Write simply and directly\n- Address users clearly\n- Communicate essential details\n- Write for all reading levels\n- Be human: write for humans, not robots\n\nFollow these guidelines to help ensure that all templates have a consistent look and feel, and to help users understand how to use your template.\n\nInfo\n----\n\nThese guidelines apply to items found in the Template Editor's **Info** tab.\n\n### Name\n\nThe template name is presented to Tag Manager users throughout the Tag Manager user interface and Community Template Gallery. It appears at the top of a template's detail page, and appears when templates are listed.\n\n- Use your company/organization name and the functional name of the template: *Organization Name* *Template Name*.\n- Use Title Case.\n- Use terms that are descriptive of the functionality.\n- Avoid use of the term \"Official\" in template names, unless you are authorized to do so by the relevant organization.\n\n**Examples:** *MyCompany Conversion Measurement Tag, MyCompany Campaign ID Variable*\n\n### Description\n\nThe template description is a description of the template that appears on detail pages as a brief summary of the template functionality.\n\n- Use clear and concise sentences to describe what the template does.\n- Clearly state how your template benefits the user. For example: \"The Example.com Audience Builder template can help you build new audience lists from website visitors.\"\n- Avoid jargon.\n- Include links for additional information, documentation, and support.\n\n### Icon\n\nYour template icon is represented as a thumbnail when listed in Tag Manager and on the Community Template Gallery.\n\n- Use PNG, JPEG, or GIF for the image format.\n- Image should be square, at least 48px by 48px, and no larger than 96px by 96px.\n- File size must be less than 50 kilobytes.\n- Avoid use of official company logos, unless you are authorized to do so by the relevant organization.\n- Fields\n- Use the Template Editor's Fields tab to add form elements such as text input, checkboxes, etc.\n\nFields\n------\n\nThese style guidelines apply to the Template Editor's **Fields** tab.\n\n### Parameter name\n\nThis is the name of the field as it appears in the Template Editor, but not as it appears to the user. Names should be descriptive of the type of data used. Format parameter names as `lowerCamelCase`. **Examples:** *userName, customerID, shoppingCartValue*.\n\n### Field labels\n\nField labels include display name fields, checkbox text, and related items.\n\n- Use sentence case.\n- Shorter is better.\n- Be descriptive.\n- Use common words.\n\nHelp text\n---------\n\nHelp text is informational content, shown as a tooltip, to help the user enter a valid value into the template field. Provide example input, if possible, and describe how the template field is used or the effect of providing certain values.\n\n- Use sentence case.\n- Be concise, but be human. It's okay to use contractions and write in the 2nd person (you).\n- Supported field types\n- Basic HTML formatting is permitted. Examples: *`\u003cstrong\u003e`, `\u003cem\u003e`*.\n\nSupported field types\n---------------------\n\n| Type | Description |\n|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Text input** | Text input. The value of a template parameter of this type will be a string that may refer to variables. The text input widget rendered in the Tag Manager user interface could be either a single-line text field or a multi-line input. |\n| **Drop-down menu** | Drop-down menu in which only a single item could be selected as the value of the template parameter. List items in alphabetical order unless there is a good reason to do otherwise. |\n| **Checkbox** | Checkbox input. The value of a template parameter of this type will be boolean: true for checked, false for unchecked. |\n| **Radio button** | Radio input. A template parameter of this type presents a list of choices in the Tag Manager user interface and the user is only allowed to pick one of the choices as the value of the template parameter. |\n| **Simple table** | A simple table input. Each cell in the table can be edited in place, and each cell can only be of two types: a text input or a drop-down menu. The value of a template parameter of this type is an array of objects: each object encodes a row, each key in the object must be one of the column names, and each value in the object is the value of the corresponding cell. |"]]