Google Analytics 通訊協議參數說明 version 2

這是一份非官方的文檔。定義可能在未來發生變化,而不做進一步通知。

Introduction

Google Analytics的測量協議(Measurement Protocol)允許使用者和開發人員直接向Google Analytics端點發送HTTP請求,以測量使用者如何從任何環境/平台進行交互。

我試圖反向工程所有我能夠獲取關於這個即將推出的新協議所使用的參數的詳細信息,以及對照 GTM Tag Template API - getAllEventData() 所對應的參數名稱。

這是一份非官方的文檔。定義可能在未來發生變化,而不做進一步通知。

Parameters Reference

PARAMETERVALUE TYPEVALUEEvent Data Name
vintProtocol Versionx-ga-protocol_version
tidstringMeasurement ID (G-XXXXXX)x-ga-measurement_id
gtmstringGTM Versionx-ga-gtm_version
cidstringGoogle Analytics Client IDx-ga-js_client_id
ulstringUser Languagelanguage
srstringScreen Resolutionscreen_resolution
_pintRandom Page Load Hashx-ga-page_id
_sintCurrent hits counter for the current page loadx-ga-request_count
_dbgintIs Debugx-ga-system_properties.dbg
gcsstringGoogle Consent Status (G11-)x-ga-system_properties.gcs
gcustringGoogle Consent Updatex-ga-system_properties.gcu
gcutstringGoogle Consent Update Typex-ga-system_properties.gcut
gcdstringGoogle Consent Defaultx-ga-system_properties.gcd
_rndstringx-ga-system_properties.rnd
PARAMETERVALUE TYPEVALUEEvent Data Name
uidstringUser IDuser_id
sidstringSession IDga_session_id
sctintSession Countga_session_number
segintSession Engagement, If the current user is engaged in any way, this value will be 1x-ga-mp2-seg
up.*stringUser Property (String)x-ga-mp2-user_properties.*
upn.*intUser Property (Number)x-ga-mp2-user_properties.*
_fvintFirst Visitx-ga-system_properties.fv
_ssintSession Startx-ga-system_properties.ss
_nsiintNew Session ID, If the current user has a GA4 session cookie, this value will be 1x-ga-system_properties.nsi
_gazintIt’s set when a Google Join is created/imported . Google Signalsx-ga-system_properties.gaz
_fplcstringFirst Party Linker Cookie, it’s 0 if the FPLC Cookie is not present
sst.ucstringUser Countryx-sst-system_properties.uc
richsstsse

Share

PARAMETERVALUE TYPEVALUEEvent Data Name
dlstringDocument Locationpage_location
drstringDocument Referrerpage_referrer
dtstringDocument Titlepage_title

Client Hints

PARAMETERVALUE TYPEVALUEEvent Data Name
uaastringUser Agent Architectureclient_hints.architecture
uabstringUser Agent Bitnessclient_hints.bitness
uafvlarrayUser Agent Full Version Listclient_hints.brands
uambbooleanUser Agent Mobileclient_hints.mobile
uamstringUser Agent Modelclient_hints.model
uapstringUser Agent Platformclient_hints.platform
uapvstringUser Agent Platform Versionclient_hints.platform_version
uawbooleanUser Agent WOW64client_hints.wow64

Event Parmeters

PARAMETERVALUE TYPEVALUEEvent Data Name
enstringEvent Nameevent_name
ep.*stringEvent Parameter (String)*
epn.*intEvent Parameter (Number)*
_etintEngagement Timeengagement_time_msec
_cintIs Conversionx-ga-system_properties.c

Ecommerce Main

PARAMETERVALUE TYPEVALUEEvent Data Name
custringCurrency Codecurrency
pr[0-9]{1,200}stringAn Item Object. It’s a string containing an item details and all it’s params. Check Item Parameters block for more detailsitems[0-9]

Items

PARAMETERVALUE TYPEVALUEEvent Data Name
nmstringItem Nameitem[n].item_name
idstringItem IDitem[n].item_id
printItem Priceitem[n].price
brstringItem Branditem[n].item_brand
castringItem Category 1item[n].item_category
ca2stringItem Category 2item[n].item_category2
ca3stringItem Category 3item[n].item_category3
ca4stringItem Category 4item[n].item_category4
ca5stringItem Category 5item[n].item_category5
qtintItem Quantityitem[n].quantity
vastringItem Variantitem[n].item_variant
cpstringCouponitem[n].coupon
dsintDiscountitem[n].discount
listringItem List IDitem[n].item_list_id
lnstringItem List Nameitem[n].item_list_name
lpintIndexitem[n].index
afstringAffiliationitem[n].affiliation
lostringlocation IDitem[n].location_id
k[0-9]stringItem Custom Keyitem[n].key
v[0-9]stringItem Custom Valueitem[n].value

Summary

這份文件介紹了Google Analytics Measurement Protocol的參數,其中包括用戶和會話相關參數、共享參數、客戶端提示、事件參數、電子商務主要參數和項目參數。這份文件提供了每個參數的名稱、值類型和值,並將其與Google Tag Manager Tag Template API返回的事件資料對應。

評論