規劃代碼設定
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
安裝代碼前,請先查看現有的網站或應用程式設定,並分析可能已採用的評估產品和做法。以下列出一些問題供您參考:
評估目標
開始設定任何成效評估產品前,請先考量您的業務目標。商家的一些目標範例包括:
- 廣告點擊次數
- 廣告活動帶來多少新訂閱
- 有多少次網站造訪促成購物車結帳
- 最成功的行銷管道
- 使用者介面元素的最佳放置位置,可提高轉換機率
- 哪些產品在網站的電子商務漏斗中表現最佳
- 通常會先發生哪些動作,才會產生成功的轉換
您也可以找出上述目標的反面,來設定排除目標。舉例來說,找出難以產生轉換的相關行銷管道,就是有助改善整體行銷活動的排除目標。
根據業務目標,決定要使用哪些產品、要評估哪些事件、可能需要哪些檢測工具,以及要查看哪些報表。這些決策應會影響成效評估導入策略。
請注意,業務目標並非一成不變,而是需要經常重新評估的問題。隨著資料收集量增加,您可能會想進一步調整導入策略,以便回答更多業務問題。
Google 代碼管理工具、Google 代碼或 Firebase?
如果您是新手,可能會想知道:我該使用 Google 代碼、Google 代碼管理工具還是 Firebase?
如果您的網站平台或內容管理系統允許,Google 代碼管理工具應是部署數據分析和行銷代碼的首選。代碼管理工具可讓您以最靈活的方式設定部署網站代碼的時間和方式。即使您只需要為單一 Google 產品 (例如 Google Ads) 使用這項功能,代碼管理工具也會為日後可能的產品整合作業準備評估計畫。
Google 代碼:如果您尚未為網頁加入代碼,或是只想為單一產品 (例如 Google Ads) 加入網頁代碼,且不打算隨時間變更,那麼安裝 Google 代碼可能是最快、最簡單的起步方式。Google 代碼是您加到網頁的程式碼片段。進一步瞭解 Google 代碼安裝程序。
Google 代碼管理工具:代碼管理工具是一套功能齊全、效能強大的企業級代碼管理系統,可支援網站和行動應用程式的 Google、第三方和自訂代碼。您可以透過代碼管理工具介面新增及修改代碼,無須調整網站上的程式碼。此外,代碼管理工具還支援第三方代碼、機構功能、版本控制,以及企業協作和安全性功能。代碼管理工具可讓您建立自訂代碼和變數範本,並與團隊分享,您也可以在社群範本庫中部署及使用範本。您可以使用伺服器端代碼,將程式碼從用戶端移至雲端,進一步提升效能和安全性。進一步瞭解代碼管理工具。
Firebase 是 Google 推出的一套工具組,支援行動裝置,包括 iOS 和 Android。Firebase 包含 Google 產品的評估架構,例如 Google Ads 和 Google Analytics。如果您需要在行動應用程式中設定評估功能,請使用 Firebase。
評估目標有助於判斷應使用哪種代碼工具:
- 如果主要評估目標與 Google Ads 成效相關,建議使用 Google 代碼。
- 如果主要目標是評估網站的所有流量,建議使用 Google 代碼。
- 如果您想評估 Google Ads、Google Analytics 和其他評估平台,建議使用 Google 代碼管理工具。
- 如要評估行動裝置上的廣告活動和使用情形,請使用 Firebase。
無論您的評估目標為何,都建議安裝 Google 代碼管理工具,因為這項工具可讓您靈活運用各種 Google (和第三方) 評估和廣告產品。
與內容管理和電子商務系統整合
許多內容管理和電子商務系統都提供可立即整合的 Google 成效評估產品。在平台範本中新增 Google 代碼片段或安裝 Google 代碼管理工具之前,請先查看供應商的支援文件,瞭解平台是否已提供 Google 代碼的內建整合功能。
請注意,這些整合功能通常可能會缺少所代表評估堆疊的重要功能和最新更新。請務必查看說明文件,並視需要諮詢平台支援團隊。
第三方代碼管理系統
Google 代碼通常是透過第三方代碼管理系統部署。使用第三方代碼管理平台時,無論如何,您都應參考 Google 代碼版本的 Google 代碼說明文件,並盡可能參考第三方供應商的說明文件。
現有的代碼安裝和檢測
請考量您可能已安裝的代碼設定。如果您已安裝及部署代碼,請檢查代碼設定,確保已正確設定及最佳化。如果您使用的是舊版代碼程式庫 (例如 analytics.js 或 conversions.js),請升級代碼設定,改用最新支援的方法。請避免安裝多餘的代碼或代碼管理系統,並盡可能提高代碼設定的效率。
如要快速瞭解網站現有的代碼設定,請使用 Google Tag Assistant。執行 Tag Assistant,自動偵測代碼設定和產品 ID。
您也可以手動在原始碼中搜尋現有的標記。
如果有現有的代碼平台,您也應調查任何現有的檢測功能。
- 是否有現有的
dataLayer
物件?如果有的話,請問該資料夾會顯示哪些資料?
- 報表中是否顯示事件資料?如果是的話,是什麼?
- 事件資料的收集方式
進一步瞭解如何分析現有的代碼設定。
針對 Google 代碼管理工具安裝作業
代碼管理工具安裝作業還有其他考量因素:
管理人員變更
一開始建立「代碼管理工具」帳戶後,建議您制定長遠策略,決定好誰來擔任帳戶的固定管理員,還有團隊成員職責變動時處理帳戶擁有權的方式。
制定長遠策略有好處:就算有人離職後帳戶憑證終止使用,您還是可以確保機構保有存取代碼管理工具帳戶的權限。有些機構會將系統管理員角色授予多名使用者。有些機構則會建立一個專屬的主要 Google 帳戶,專門管理自家機構的「代碼管理工具」。請選擇最適合您的系統。
每個機構組織只需使用一個代碼管理工具帳戶
每個機構應設定一個「代碼管理工具」帳戶,且這個帳號應由需要管理代碼的機構組織負責建立。舉例來說,如果您的公司委託代理商管理代碼,則應由您的公司建立 Google 代碼管理工具帳戶,然後將代理商的 Google 帳戶新增為使用者。
提供額外的安全控管功能,強化 IT 團隊的效能
貴公司的 IT 部門可能會對 Google 代碼管理工具提供的自由部署方式感到疑慮。IT 人員可以部署額外的安全措施,例如內容安全性政策、自訂限制和自訂範本政策。
使用區域管理存取權
代理商可以在 Google 代碼管理工具的「管理」部分管理客戶的現有帳戶。一個 Google 代碼管理工具帳戶可由多個使用者共同管理,帳戶管理員也可以分別授予這些人不同的存取權限,Google 代碼管理工具 360 客戶則可使用區域功能來新增和控制其他容器。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-18 (世界標準時間)。
[null,null,["上次更新時間:2024-11-18 (世界標準時間)。"],[[["\u003cp\u003eBefore installing tags, analyze your website or app's current measurement setup and goals to determine the best approach.\u003c/p\u003e\n"],["\u003cp\u003eChoose Google Tag Manager for flexibility and future scalability, Google tag for simple setups, or Firebase for mobile apps.\u003c/p\u003e\n"],["\u003cp\u003eConsider existing tag configurations and instrumentation to avoid redundancy and optimize your setup.\u003c/p\u003e\n"],["\u003cp\u003eFor Google Tag Manager, plan for long-term account management, utilize a single account per organization, and empower IT with security controls.\u003c/p\u003e\n"]]],["Before setting up tags, analyze existing website configurations and measurement practices. Define business goals to guide decisions on which measurement products, events, and reports to prioritize. Choose between Google Tag Manager, Google tag, or Firebase based on these goals. Assess existing tag platforms and instrumentation, including `dataLayer` objects and event data. For Tag Manager, establish a strategy for account management, security, and access controls. Ensure efficient and non-redundant tag configurations, and upgrade to the latest tag methods if necessary.\n"],null,["# Plan your tag setup\n\nBefore you install tags, you should look at your existing website or app\nconfiguration and analyze what measurement products and practices might already\nbe in place. Some questions to consider include:\n\n- [What are your measurement goals](#measurement_goals)?\n- [Should you use Google Tag Manager, gtag.js, or\n Firebase](#gtm_gtag_fb)?\n- [Do you have existing tags installed through Tag Manager, Google tag,\n Firebase, or other platforms](#existing_tag_platforms_and_instrumentation)?\n- [What custom instrumentation exists currently to collect data](#existing_tag_platforms_and_instrumentation)? For example: Do you have a way to collect ecommerce data on your site or app?\n\nMeasurement goals\n-----------------\n\nBefore you begin any measurement product setup, consider what your business\ngoals are first. Some example goals for your business might include:\n\n- How often an ad is clicked\n- How many new subscriptions come from ad campaigns\n- How many site visits result in cart checkouts\n- What your most successful marketing channels are\n- What the optimal placement of user interface elements is for the highest conversion probability\n- Which products fare best in the ecommerce funnel of the website\n- What actions typically precede a successful conversion\n\nAlso consider negative goals by identifying the opposite of the above goals. For\nexample, identifying marketing channels that struggle to produce conversions is\na relevant negative goal to help you improve your overall marketing efforts.\n\nUse your business goals to help you decide what products to use, which events\nyou want to measure, what instrumentation you might need, and what reports you'd\nlike to see. These decisions should drive your measurement implementation\nstrategy.\n\nRemember that business goals are not set in stone; they're questions you need to\nre-evaluate frequently. As you collect more data, additional business questions\nmight emerge that you'll want to refine in your implementation strategy, too.\n\nGoogle Tag Manager, Google tag, or Firebase?\n--------------------------------------------\n\nIf you're new to tagging, you might be asking: What should I use - the Google\ntag, Google Tag Manager, or Firebase?\n\nIf your site platform or Content Management System permits it, Google Tag\nManager should be your first choice for deploying analytics and marketing tags.\nTag Manager gives you the most flexibility in how and when to deploy site tags.\nEven if you only need it for a single Google product (such as Google Ads), Tag\nManager prepares your measurement plan for possible future product integrations\nas well.\n\n**Google tag:** If you haven't tagged your web pages yet, or only intend to\ntag your pages for one product (e.g. Google Ads) with few changes over time,\nthen a Google tag installation may be the fastest and easiest method to get\nstarted. The Google tag is a snippet of code that you add to a web page.\n[Learn more about Google tag installation](/tag-platform/gtagjs/install).\n\n**Google Tag Manager:** Tag Manager is a robust, fully featured, enterprise-\ngrade tag management system that supports Google, third-party, and custom tags\nfor web and mobile apps. You can add and modify tags through the Tag Manager\ninterface without adjusting the code on your site. In addition, Tag Manager\nfeatures support for third-party tags, organization features, version control,\nand enterprise collaboration and security features. Tag Manager features the\nability to create [custom tag and variable templates](/tag-platform/tag-manager/templates) that you can share with your\nteam, and you can deploy and use templates in the\n[Community Template Gallery](http://tagmanager.google.com/gallery).\nYou can use [server-side tagging](/tag-platform/tag-manager/server-side) to move code out of the client side and into\nthe cloud for additional performance and security benefits.\n[Learn more about Tag Manager](/tag-platform/tag-manager).\n\n**Firebase** Firebase is a toolset by Google that supports mobile devices,\nincluding [iOS](https://firebase.google.com/docs/ios/setup) and [Android](https://firebase.google.com/docs/android/setup). Firebase includes measurement frameworks for\nGoogle products such as [Google Ads](https://firebase.google.com/docs/ads) and [Google Analytics](https://firebase.google.com/docs/analytics). Use Firebase if you\nneed to set up measurement on mobile apps.\n\nYour measurement goals may help to inform which tagging tool you should use:\n\n- If your primary measurement goal is related to Ads performance, consider using the Google tag.\n- If your primary goal is to measure all traffic to your site, consider using the Google tag.\n- If you want to measure Google Ads, Google Analytics, and other measurement platforms, consider using Google Tag Manager.\n- If you want to measure campaigns and usage on mobile devices, use Firebase.\n\nRegardless of your measurement goals, consider installing Google Tag Manager,\nas it gives you the most flexibility in working with a range of Google (and\nthird-party) measurement and advertising products.\n\nIntegration with content management and ecommerce systems\n---------------------------------------------------------\n\nMany content management and ecommerce systems feature turnkey integration with\nGoogle measurement products. Before you proceed with adding the Google tag snippet or\ninstalling Google Tag Manager in your platform's templates, see if your platform\nalready provides a built-in integration for Google tags by checking the\nprovider's support documentation.\n\nNote that often these integrations might be missing key features and latest\nupdates to the measurement stacks they represent. Be sure to check the\ndocumentation and consult platform support, if necessary.\n\nThird-party tag management systems\n----------------------------------\n\nGoogle tags are commonly deployed from third-party tag management systems. When\nusing a third-party tag management platform, in all cases you will want to refer\nto the Google tag version of Google's tag documentation, and whenever\npossible you should refer to the third-party vendor's documentation.\n\nExisting tag installations and instrumentation\n----------------------------------------------\n\nConsider what tag setups you may already have installed. If you have tags\nalready installed and deployed, you should review your tag configuration to\nensure it is properly configured and optimized. If you are on an older tag\nlibrary such as analytics.js or conversions.js, you should\n[upgrade your tag setup](/tag-platform/devguides/upgrade) to the latest supported method. You should avoid\ninstalling redundant tags or tag management systems, and you should try to keep\nyour tag configurations as efficient as possible.\n\nThe quickest way to figure out existing tag configurations for web sites is to\nuse [Google Tag Assistant](https://tagassistant.google.com/).\nRun Tag Assistant to automatically discover tag configurations and product IDs.\n\nYou can also manually search for existing tags in source code.\n\nIf there is an existing tag platform, you will also want to investigate any\nexisting instrumentation.\n\n- Is there an existing [`dataLayer`](/tag-platform/devguides/datalayer) object? If so, what data appears in it?\n- Does event data appear in your reports? If so, what?\n- How is event data being collected?\n\n[Learn more about analyzing existing tag configurations](/tag-platform/devguides/existing).\n\nFor Google Tag Manager installations\n------------------------------------\n\nTag Manager installations have additional considerations:\n\n### Manage personnel changes\n\nWhen you first [set up a Tag Manager account](https://support.google.com/tagmanager/answer/6103696), put a strategy in\nplace for who will manage the account over the long term, and to define how\naccount ownership will be handled should a member of your team change roles.\n\nHave a strategy that will help to ensure that if someone leaves your\norganization and their account credentials are terminated, the organization will\nmaintain access to your Tag Manager account. Some organizations delegate\n[administrator roles](https://support.google.com/tagmanager/answer/6107011) to multiple users. Others create a dedicated master Google\naccount just for Tag Manager administration for their organization. Choose the\nsystem that works best for you.\n\n### One Tag Manager account per organization\n\nSet up one Tag Manager account per organization. The organization for which the\ntags will be managed should create the Tag Manager account. For example, if an\nagency manages tags on behalf of your company, then your company should create\nthe Tag Manager account and add the agency's Google account as a user.\n\n### Empower IT with additional security controls\n\nYour company's IT department may be wary about the freedom of deployment that\nGoogle Tag Manager provides. IT can deploy additional security measures such as\n[Content Security Policies](/tag-platform/tag-manager/web/csp), [custom restrictions](/tag-platform/tag-manager/web/restrict), and\n[custom template policies](https://developers.google.com/tag-platform/tag-manager/templates/policies).\n\n### Use zones to manage access\n\nAgencies can manage their clients' existing accounts in the admin section of Tag\nManager. Multiple users can manage the same Google Tag Manager account, and each\nuser can be given different access permissions by the account administrators.\nGoogle Tag Manager 360 customers can add and control additional containers using\n[zones](https://support.google.com/tagmanager/answer/7647043)."]]