Google Analytics Measurement Protocol 平台能藉由 HTTP 要求,傳送事件直接至 Google Analytics 伺服器,提升網站和應用程式串流的評估成效。您可以記錄伺服器對伺服器和離線互動,然後以 Measurement Protocol 事件的形式傳送至 Google Analytics,再透過報表查看。
您必須使用代碼 (gtag、代碼管理工具或 Google Analytics for Firebase),才能使用這個通訊協定。如要瞭解 Measurement Protocol 如何與 Google Analytics 搭配運作,請參閱重要功能。
[null,null,["上次更新時間:2025-06-12 (世界標準時間)。"],[[["\u003cp\u003eThe Google Analytics Measurement Protocol allows you to send data directly to Google Analytics servers, enabling measurement of server-to-server, offline, and other interactions not captured by standard tagging methods.\u003c/p\u003e\n"],["\u003cp\u003eIt's primarily designed to supplement, not replace, data collection through gtag.js, Google Tag Manager, and Google Analytics for Firebase.\u003c/p\u003e\n"],["\u003cp\u003eYou can leverage the Measurement Protocol for use cases such as tying online and offline behavior, measuring interactions across various touchpoints, and capturing data from devices where automatic collection isn't feasible.\u003c/p\u003e\n"],["\u003cp\u003eTo fully utilize the features of the Measurement Protocol and access comprehensive reporting, it's essential to implement tagging using gtag.js, Google Tag Manager, or Google Analytics for Firebase.\u003c/p\u003e\n"],["\u003cp\u003eThe protocol respects user privacy settings and automatically joins data with online interactions to apply preferences for personalized ads and ad tracking limitations.\u003c/p\u003e\n"]]],["The Google Analytics Measurement Protocol sends events directly to Google Analytics servers via HTTP requests, augmenting existing data collection methods like gtag and Firebase. It enables recording server-to-server and offline interactions, such as tying online to offline behavior, measuring diverse interactions, and sending events from unsupported devices. Using tagging is mandatory and essential for its functionality. The protocol automatically joins online and offline data for privacy settings and utilizes existing geographic/device information for reporting.\n"],null,["# Measurement Protocol\n\nThe Google Analytics Measurement Protocol enhances measurement for web and app\nstreams by [sending events](/analytics/devguides/collection/protocol/ga4/sending-events) directly to Google Analytics servers in\nHTTP requests. You can record server-to-server and offline interactions, and\nsend them as Measurement Protocol events to Google Analytics, where they can be\nviewed in [reports](/analytics/devguides/reporting/data/v1/basics).\n| **Key Point:** The intent of the Measurement Protocol is to augment automatic collection through gtag, Tag Manager, and Google Analytics for Firebase, not to replace it.\n\nYou must use tagging (gTag, Tag Manager, or Google Analytics for Firebase) to\nuse this protocol. See [key features](#key_features) for important information\non how this Measurement Protocol works with Google Analytics.\n\nUse cases\n---------\n\nHere are some ways to use the Measurement Protocol:\n\n- Tie online to offline behavior.\n- Measure client-side and server-side interactions.\n- Send events that happen outside standard user-interaction, like offline conversions.\n- Send events from devices and apps where automatic collection isn't available, like kiosks and watches.\n\nRead more about how to implement common use cases in the [use cases guide](/analytics/devguides/collection/protocol/ga4/use-cases).\n\nGet started\n-----------\n\nSee [send events](/analytics/devguides/collection/protocol/ga4/sending-events) to learn how to send events to Google Analytics using the\nMeasurement Protocol.\n\nIf you're implementing the Measurement Protocol for an app stream, you can start\nwith the [Send app events to Google Analytics using Measurement Protocol](//firebase.google.com/codelabs/firebase_mp)\ncodelab.\n\nArchitecture\n------------\n\nHere is an overview of the Measurement Protocol.\n\nKey features\n------------\n\nThis section explains important information for using the Measurement Protocol.\nYou must use gTag, Tag Manager, or Google Analytics for Firebase for tagging to\nuse most of the Measurement Protocol features with Google Analytics.\n\n### Remarketing\n\nSame device remarketing is supported when [Google signals](//support.google.com/analytics/answer/9445345) is turned on. For\ncross-device remarketing, a User ID is required.\n\n### Advertising identifiers\n\nAdvertising identifiers such as GBRAID/WBRAID collected during online\ninteractions are automatically joined with Measurement Protocol events using `client_id`\nor `app_instance_id`.\n\n### Privacy settings\n\nMeasurement Protocol events are joined with online interactions using\n`client_id` or `app_instance_id` to functionally adopt user privacy settings\nsuch as \"non personalized ads\" and \"limit ad tracking\".\n\n### Geographic and device information\n\nGoogle Analytics automatically joins the most recent geographic and device\ninformation from tagging with Measurement Protocol events using `client_id` or\n`app_instance_id`. This ensures that your Measurement Protocol events are reflected in\nreports that include geographic and device dimensions.\n\nIf you want a Measurement Protocol event to reflect geographic and device information\nfrom a *specific* session instead of the latest information for the `client_id`\nor `app_instance_id`, then include `session_id` in the event and send it to\nMeasurement Protocol within 24 hours of the start of the session.\n\nYou can provide [geographic information](/analytics/devguides/collection/protocol/ga4/reference#payload_geo_info) and [device information](/analytics/devguides/collection/protocol/ga4/reference#payload_device_info) for events\nusing the Measurement Protocol.\n\nIf device information isn't collected by your tag, it defaults to\n`desktop` for Web streams, and `mobile` for App streams.\n\n### Full server-to-server\n\nWhile it's possible to send events to Google Analytics solely with the\nMeasurement Protocol, only partial reporting may be available. The purpose of the\nMeasurement Protocol is to augment existing events collected using gtag, GTM, or\nFirebase. Some event and parameter names are [reserved](/analytics/devguides/collection/protocol/ga4/reference?#reserved_names) for use through\nautomatic collection and cannot be sent through the Measurement Protocol.\n\n### Generate or rename events\n\nRules for [generating or renaming\nevents](//support.google.com/analytics/answer/10085872) aren't triggered by\nevents sent with the Measurement Protocol. Your application should implement the logic\nto send custom events through the Measurement Protocol, similar to the rules configured\nin the Google Analytics UI.\n\nNext steps\n----------\n\n- Learn how to [send events](/analytics/devguides/collection/protocol/ga4/sending-events) using the Measurement Protocol.\n- Validate your event payloads using the [Measurement Protocol validation\n server](/analytics/devguides/collection/protocol/ga4/validating-events).\n- Check out the [protocol](/analytics/devguides/collection/protocol/ga4/reference) and [event](/analytics/devguides/collection/protocol/ga4/reference/events) reference.\n\n| **Note:** All applications that use the Measurement Protocol must follow the [protocol policy](/analytics/devguides/collection/protocol/ga4/policy)"]]