Giới thiệu về tính năng gắn thẻ và thẻ Google
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Gắn thẻ là quá trình thêm các đoạn mã (được gọi là thẻ) vào mỗi trang của
trang web của bạn để bạn có thể tìm hiểu về những người truy cập vào trang web cũng như cách họ
tương tác với thiết bị đó.
Việc gắn thẻ là một phần không thể thiếu của nhiều sản phẩm đo lường, bao gồm cả Google Ads,
Google Analytics cũng như nhiều sản phẩm của bên thứ ba.
Liệu bạn có muốn biết về những bài đăng phổ biến nhất trên blog của mình, hiệu quả nhất không
trang đích hoặc các sản phẩm phổ biến nhất, dữ liệu mà bạn sẽ thu thập bằng cách gắn thẻ
cho phép bạn đưa ra quyết định sáng suốt hơn về trang web và chiến lược tiếp thị
chiến lược.
Làm quen với thẻ Google
Thẻ Google là một đoạn mã duy nhất mà bạn có thể tìm thấy trong Google Ads, Google
Analytics và các sản phẩm tương tự khác của Google. Thay vì quản lý nhiều thẻ
cho nhiều tài khoản sản phẩm Google, bạn có thể sử dụng thẻ Google trên
toàn bộ trang web và kết nối thẻ với nhiều đích đến.
Thiết lập thẻ Google
Việc thiết lập thẻ Google phụ thuộc vào cách thiết lập trang web của bạn và cách bạn có thể
thay đổi mã. Bạn có thể triển khai thẻ Google trên trang web của mình ở một trong
các cách sau:
Trình quản lý thẻ của Google: Hệ thống quản lý thẻ giúp bạn thiết lập và
quản lý thẻ trên trang web mà không cần thay đổi mã của bạn. Để sử dụng Trình quản lý thẻ, bạn
thêm 2 đoạn mã vào mỗi trang trên trang web của bạn. Sau khi bạn thêm thuộc tính
các đoạn mã vào mã của mình, bạn không cần phải thay đổi mã nhiều sau đó;
thay vào đó, bạn có thể thiết lập và quản lý thẻ thông qua trang web của Trình quản lý thẻ.
gtag.js: Khung JavaScript cho phép bạn gửi dữ liệu từ trang web của mình đến
Các sản phẩm đo lường của Google. Để thiết lập gtag.js, bạn thêm 1 đoạn mã vào
từng trang trên trang web của bạn. Để sử dụng hiệu quả gtag.js, bạn cần phải thoải mái
thay đổi JavaScript trên trang web.
Trường hợp bạn sử dụng một trình tạo trang web hoặc hệ thống quản lý nội dung như Shopify, Wix hoặc
WordPress, trình tạo trang web hoặc hệ thống quản lý nội dung có thể cung cấp
để thiết lập Trình quản lý thẻ hoặc gtag.js trên trang web của bạn.
Cách thiết lập thẻ đo lường và thẻ quảng cáo trong ứng dụng di động:
sử dụng SDK Google Analytics cho Firebase. Sau đó, bạn cũng có thể
sử dụng Trình quản lý thẻ để sửa đổi và định tuyến dữ liệu trong ứng dụng dành cho thiết bị di động.
Các bước tiếp theo
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eTagging involves adding code snippets to web pages to gather data on visitor behavior and site performance.\u003c/p\u003e\n"],["\u003cp\u003eThe Google tag streamlines tag management, allowing connection to multiple Google products with a single code snippet.\u003c/p\u003e\n"],["\u003cp\u003eImplementing tags can be done through Google Tag Manager or gtag.js, offering varying levels of coding involvement.\u003c/p\u003e\n"],["\u003cp\u003eWebsite builders and content management systems often provide integrations for simplified tag setup.\u003c/p\u003e\n"],["\u003cp\u003eMobile app tagging utilizes the Google Analytics for Firebase SDK and can be managed through Tag Manager.\u003c/p\u003e\n"]]],["Tagging involves adding code snippets to website pages to track user behavior and gain insights for informed decision-making. The Google tag, a unified code snippet, can be implemented across a website and connected to multiple Google products. Implementation methods include Google Tag Manager, which requires two code snippets and allows tag management without coding, and gtag.js, requiring one code snippet and JavaScript proficiency. Website builders and the Firebase SDK offer integrations for simplified implementation.\n"],null,["# Introduction to tagging and the Google tag\n\nTagging is the process of adding snippets of code (called tags) to each page of\nyour website so you can learn about the people who visit your site and how they\ninteract with it.\n\nTagging is an integral part of many measurement products, including Google Ads,\nGoogle Analytics, and many third-party products too.\n\nWhether you want to know about your most popular blog posts, most effective\nlanding pages, or most popular products, the data you'll collect through tagging\nlets you make more informed decisions about your site and your marketing\nstrategies.\n\nGet started with the Google tag\n-------------------------------\n\nThe Google tag is a single piece of code that you can find in Google Ads, Google\nAnalytics, and other similar Google products. Instead of managing multiple tags\nfor different Google product accounts, you can use the Google tag across your\nentire website and connect the tag to multiple destinations.\n\nSet up the Google tag\n---------------------\n\nSetting up the Google tag depends on how your site is set up and how you can\nchange the code. You can implement the Google tag on your site in one of the\nfollowing ways:\n\n- **Google Tag Manager**: A tag management system that lets you set up and\n manage tags on your site without changing your code. To use Tag Manager, you\n add 2 snippets of code to each page of your website. After you add the\n snippets to your code, you don't need to change your code much after that;\n instead, you can set up and manage your tags through the Tag Manager website.\n\n- **gtag.js**: A JavaScript framework that lets you send data from your site to\n Google measurement products. To set up gtag.js, you add 1 snippet of code to\n each page of your site. To use gtag.js effectively, you need to be comfortable\n changing JavaScript on your site.\n\nIf you use a website builder or content management system like Shopify, Wix, or\nWordpress, the website builder or content management system may offer an\nintegration for setting up Tag Manager or gtag.js on your site.\n\nTo set up measurement and advertising tags in a mobile app,\nuse the Google Analytics for Firebase SDK. Then, you can also\nuse Tag Manager to modify and route data in the mobile app.\n\nNext steps\n----------\n\n- [Plan your tag setup](/tag-platform/devguides/prerequisites)\n- Set up the Google tag with:\n - [Tag Manager](https://support.google.com/tagmanager/answer/6102821)\n - [gtag.js](/tag-platform/gtagjs/install)\n - [a website builder or CMS](https://support.google.com/tagmanager/answer/12403447)\n - [the Google Analytics for Firebase SDK](https://firebase.google.com/docs/analytics)"]]