คู่มือแนะนำสไตล์ของเทมเพลต
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คู่มือแนะนำนี้จัดทำขึ้นเพื่อช่วยคุณตัดสินใจเกี่ยวกับวิธีเตรียมเทมเพลตสำหรับแกลเลอรีเทมเพลตชุมชน คู่มือสไตล์นี้อิงตามหลักการเขียนของ Google Material Design กล่าวโดยย่อคือ
- ใช้ชื่อที่กระชับ
- เขียนให้เข้าใจง่ายและตรงประเด็น
- ระบุผู้ใช้อย่างชัดเจน
- สื่อสารรายละเอียดที่สำคัญ
- เขียนให้เหมาะกับผู้อ่านทุกระดับ
- เขียนให้มนุษย์อ่าน ไม่ใช่เขียนให้โรบ็อตอ่าน
ปฏิบัติตามหลักเกณฑ์เหล่านี้เพื่อให้มั่นใจว่าเทมเพลตทั้งหมดมีรูปลักษณ์ที่สอดคล้องกันและช่วยให้ผู้ใช้เข้าใจวิธีใช้เทมเพลต
ข้อมูล
หลักเกณฑ์เหล่านี้มีผลกับรายการที่พบในแท็บข้อมูลของเครื่องมือแก้ไขเทมเพลต
ชื่อ
ชื่อเทมเพลตจะแสดงต่อผู้ใช้ Tag Manager ทั่วทั้งอินเทอร์เฟซผู้ใช้ Tag Manager และแกลเลอรีเทมเพลตชุมชน โดยจะปรากฏที่ด้านบนของหน้ารายละเอียดของเทมเพลต และปรากฏขึ้นเมื่อแสดงเทมเพลต
- ใช้ชื่อบริษัท/องค์กรและชื่อฟังก์ชันของเทมเพลต: ชื่อองค์กร ชื่อเทมเพลต
- ใช้อักษรตัวพิมพ์ใหญ่สำหรับชื่อ
- ใช้คำที่สื่อถึงฟังก์ชันการทำงาน
- หลีกเลี่ยงการใช้คำว่า "อย่างเป็นทางการ" ในชื่อเทมเพลต เว้นแต่คุณจะได้รับอนุญาตจากองค์กรที่เกี่ยวข้อง
ตัวอย่าง: แท็กการวัด Conversion ของ MyCompany, ตัวแปรรหัสแคมเปญของ MyCompany
คำอธิบาย
คําอธิบายเทมเพลตคือคําอธิบายของเทมเพลตที่ปรากฏในหน้ารายละเอียดเป็นข้อมูลสรุปสั้นๆ เกี่ยวกับฟังก์ชันการทํางานของเทมเพลต
- ใช้ประโยคที่กระชับและชัดเจนเพื่ออธิบายสิ่งที่เทมเพลตทํา
- ระบุอย่างชัดเจนว่าเทมเพลตของคุณมีประโยชน์ต่อผู้ใช้อย่างไร เช่น "เทมเพลตเครื่องมือสร้างกลุ่มเป้าหมายของ Example.com ช่วยให้คุณสร้างรายการกลุ่มเป้าหมายใหม่จากผู้เข้าชมเว็บไซต์ได้"
- หลีกเลี่ยงการใช้คำศัพท์เฉพาะทาง
- ใส่ลิงก์สำหรับข้อมูลเพิ่มเติม เอกสารประกอบ และการสนับสนุน
Icon
ไอคอนเทมเพลตจะแสดงเป็นภาพขนาดย่อเมื่อแสดงใน Tag Manager และในแกลเลอรีเทมเพลตชุมชน
- ใช้รูปแบบรูปภาพเป็น PNG, JPEG หรือ GIF
- รูปภาพควรเป็นรูปสี่เหลี่ยมจัตุรัสขนาดอย่างน้อย 48 x 48 พิกเซล แต่ไม่เกิน 96 x 96 พิกเซล
- ไฟล์ต้องมีขนาดไม่เกิน 50 กิโลไบต์
- หลีกเลี่ยงการใช้โลโก้อย่างเป็นทางการของบริษัท เว้นแต่จะได้รับอนุญาตจากองค์กรที่เกี่ยวข้อง
- ช่อง
- ใช้แท็บช่องของเครื่องมือแก้ไขเทมเพลตเพื่อเพิ่มองค์ประกอบของแบบฟอร์ม เช่น การป้อนข้อความ ช่องทําเครื่องหมาย ฯลฯ
ช่อง
หลักเกณฑ์ด้านรูปแบบเหล่านี้มีผลกับแท็บช่องของเครื่องมือแก้ไขเทมเพลต
ชื่อพารามิเตอร์
นี่คือชื่อของช่องตามที่ปรากฏในเครื่องมือแก้ไขเทมเพลต แต่ไม่ใช่ชื่อที่ปรากฏต่อผู้ใช้ ชื่อควรสื่อถึงประเภทข้อมูลที่นำมาใช้ รูปแบบชื่อพารามิเตอร์เป็น lowerCamelCase
ตัวอย่าง: userName, customerID, shoppingCartValue
ป้ายกํากับช่อง
ป้ายกํากับช่องประกอบด้วยช่องชื่อที่แสดง ข้อความช่องทําเครื่องหมาย และรายการที่เกี่ยวข้อง
- ขึ้นต้นประโยคด้วยตัวพิมพ์ใหญ่ หรือใช้ตัวพิมพ์ใหญ่กับอักษรตัวแรกของคำและวิสามานยนาม (สำหรับภาษาอังกฤษ)
- ยิ่งสั้นยิ่งดี
- สื่อความหมาย
- ใช้คำทั่วไป
ข้อความช่วยเหลือ
ข้อความช่วยเหลือคือเนื้อหาที่ให้ข้อมูล ซึ่งแสดงเป็นเคล็ดลับเครื่องมือเพื่อช่วยให้ผู้ใช้ได้ป้อนค่าที่ถูกต้องในช่องเทมเพลต ระบุตัวอย่างอินพุต (หากเป็นไปได้) และอธิบายวิธีใช้ช่องเทมเพลตหรือผลที่ได้จากการให้ค่าบางอย่าง
- ขึ้นต้นประโยคด้วยตัวพิมพ์ใหญ่ หรือใช้ตัวพิมพ์ใหญ่กับอักษรตัวแรกของคำและวิสามานยนาม (สำหรับภาษาอังกฤษ)
- ใช้ชื่อที่กระชับแต่ดูเป็นธรรมชาติ คุณใช้คําย่อและเขียนในรูปบุคคลที่ 2 (คุณ) ได้
- ประเภทช่องที่รองรับ
- อนุญาตให้ใช้การจัดรูปแบบ HTML พื้นฐาน ตัวอย่าง:
<strong>
, <em>
ประเภทช่องที่รองรับ
ประเภท |
คำอธิบาย |
การป้อนข้อความ |
การป้อนข้อความ ค่าของพารามิเตอร์เทมเพลตประเภทนี้จะเป็นสตริงที่อาจอ้างอิงถึงตัวแปร วิดเจ็ตการป้อนข้อความที่แสดงผลในอินเทอร์เฟซผู้ใช้ของ Tag Manager อาจเป็นช่องข้อความแบบบรรทัดเดียวหรือแบบหลายบรรทัดก็ได้ |
เมนูแบบเลื่อนลง |
เมนูแบบเลื่อนลงที่เลือกได้เพียงรายการเดียวเป็นค่าของพารามิเตอร์เทมเพลต แสดงรายการตามลำดับตัวอักษร เว้นแต่จะมีเหตุผลอันสมควรที่จะทำอย่างอื่น |
ช่องทำเครื่องหมาย |
การป้อนช่องทําเครื่องหมาย ค่าของพารามิเตอร์เทมเพลตประเภทนี้จะเป็นแบบบูลีน: จริงสำหรับเลือกไว้ และเท็จสำหรับไม่ได้เลือก |
ปุ่มตัวเลือก |
อินพุตวิทยุ พารามิเตอร์เทมเพลตประเภทนี้จะแสดงรายการตัวเลือกในอินเทอร์เฟซผู้ใช้ของ Tag Manager และผู้ใช้จะเลือกได้เพียงตัวเลือกเดียวเป็นค่าของพารามิเตอร์เทมเพลต |
ตารางธรรมดา |
อินพุตตารางธรรมดา แต่ละเซลล์ในตารางแก้ไขได้ในที่นั้น และแต่ละเซลล์เป็นได้เพียง 2 ประเภท ได้แก่ อินพุตข้อความหรือเมนูแบบเลื่อนลง ค่าของพารามิเตอร์เทมเพลตประเภทนี้คืออาร์เรย์ของออบเจกต์ โดยออบเจกต์แต่ละรายการจะเข้ารหัสแถว คีย์แต่ละรายการในออบเจกต์ต้องเป็นชื่อคอลัมน์ใดคอลัมน์หนึ่ง และค่าแต่ละค่าในออบเจกต์คือค่าของเซลล์ที่เกี่ยวข้อง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\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. |"]]