Google Analytics 通訊協議參數說明 version 2
這是一份非官方的文檔。定義可能在未來發生變化,而不做進一步通知。
Introduction
Google Analytics的測量協議(Measurement Protocol)允許使用者和開發人員直接向Google Analytics端點發送HTTP請求,以測量使用者如何從任何環境/平台進行交互。
我試圖反向工程所有我能夠獲取關於這個即將推出的新協議所使用的參數的詳細信息,以及對照 GTM Tag Template API - getAllEventData() 所對應的參數名稱。
這是一份非官方的文檔。定義可能在未來發生變化,而不做進一步通知。
Parameters Reference
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| v | int | Protocol Version | x-ga-protocol_version |
| tid | string | Measurement ID (G-XXXXXX) | x-ga-measurement_id |
| gtm | string | GTM Version | x-ga-gtm_version |
| cid | string | Google Analytics Client ID | x-ga-js_client_id |
| ul | string | User Language | language |
| sr | string | Screen Resolution | screen_resolution |
| _p | int | Random Page Load Hash | x-ga-page_id |
| _s | int | Current hits counter for the current page load | x-ga-request_count |
| _dbg | int | Is Debug | x-ga-system_properties.dbg |
| gcs | string | Google Consent Status (G11-) | x-ga-system_properties.gcs |
| gcu | string | Google Consent Update | x-ga-system_properties.gcu |
| gcut | string | Google Consent Update Type | x-ga-system_properties.gcut |
| gcd | string | Google Consent Default | x-ga-system_properties.gcd |
| _rnd | string | x-ga-system_properties.rnd |
User & Session Related
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| uid | string | User ID | user_id |
| sid | string | Session ID | ga_session_id |
| sct | int | Session Count | ga_session_number |
| seg | int | Session Engagement, If the current user is engaged in any way, this value will be 1 | x-ga-mp2-seg |
| up.* | string | User Property (String) | x-ga-mp2-user_properties.* |
| upn.* | int | User Property (Number) | x-ga-mp2-user_properties.* |
| _fv | int | First Visit | x-ga-system_properties.fv |
| _ss | int | Session Start | x-ga-system_properties.ss |
| _nsi | int | New Session ID, If the current user has a GA4 session cookie, this value will be 1 | x-ga-system_properties.nsi |
| _gaz | int | It’s set when a Google Join is created/imported . Google Signals | x-ga-system_properties.gaz |
| _fplc | string | First Party Linker Cookie, it’s 0 if the FPLC Cookie is not present | |
| sst.uc | string | User Country | x-sst-system_properties.uc |
| richsstsse |
Share
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| dl | string | Document Location | page_location |
| dr | string | Document Referrer | page_referrer |
| dt | string | Document Title | page_title |
Client Hints
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| uaa | string | User Agent Architecture | client_hints.architecture |
| uab | string | User Agent Bitness | client_hints.bitness |
| uafvl | array | User Agent Full Version List | client_hints.brands |
| uamb | boolean | User Agent Mobile | client_hints.mobile |
| uam | string | User Agent Model | client_hints.model |
| uap | string | User Agent Platform | client_hints.platform |
| uapv | string | User Agent Platform Version | client_hints.platform_version |
| uaw | boolean | User Agent WOW64 | client_hints.wow64 |
Event Parmeters
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| en | string | Event Name | event_name |
| ep.* | string | Event Parameter (String) | * |
| epn.* | int | Event Parameter (Number) | * |
| _et | int | Engagement Time | engagement_time_msec |
| _c | int | Is Conversion | x-ga-system_properties.c |
Ecommerce Main
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| cu | string | Currency Code | currency |
| pr[0-9]{1,200} | string | An Item Object. It’s a string containing an item details and all it’s params. Check Item Parameters block for more details | items[0-9] |
Items
| PARAMETER | VALUE TYPE | VALUE | Event Data Name |
|---|---|---|---|
| nm | string | Item Name | item[n].item_name |
| id | string | Item ID | item[n].item_id |
| pr | int | Item Price | item[n].price |
| br | string | Item Brand | item[n].item_brand |
| ca | string | Item Category 1 | item[n].item_category |
| ca2 | string | Item Category 2 | item[n].item_category2 |
| ca3 | string | Item Category 3 | item[n].item_category3 |
| ca4 | string | Item Category 4 | item[n].item_category4 |
| ca5 | string | Item Category 5 | item[n].item_category5 |
| qt | int | Item Quantity | item[n].quantity |
| va | string | Item Variant | item[n].item_variant |
| cp | string | Coupon | item[n].coupon |
| ds | int | Discount | item[n].discount |
| li | string | Item List ID | item[n].item_list_id |
| ln | string | Item List Name | item[n].item_list_name |
| lp | int | Index | item[n].index |
| af | string | Affiliation | item[n].affiliation |
| lo | string | location ID | item[n].location_id |
| k[0-9] | string | Item Custom Key | item[n].key |
| v[0-9] | string | Item Custom Value | item[n].value |
Summary
這份文件介紹了Google Analytics Measurement Protocol的參數,其中包括用戶和會話相關參數、共享參數、客戶端提示、事件參數、電子商務主要參數和項目參數。這份文件提供了每個參數的名稱、值類型和值,並將其與Google Tag Manager Tag Template API返回的事件資料對應。
本部落格所有文章除特別聲明外,均採用CC BY-NC-SA 4.0 授權協議。轉載請註明來源 隨勛所欲!
評論











