常见事件数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
下面是不同类型的事件中常见的事件数据。可以使用事件数据变量或 getEventData
API 检索这些值。
参数 |
类型 |
示例 |
说明 |
client_id |
string |
ABC_123 |
以匿名方式标识特定用户、设备或浏览器实例的任意 ID。 |
currency |
string |
USD |
与事件相关的购买或商品所用的币种(采用由 3 个字母表示的 ISO_4217 格式)。 |
event_name |
string |
purchase |
事件名称。 |
ip_override |
string |
1.2.3.4 |
IPv4 或 IPv6 格式的用户 IP 地址。 |
language |
string |
en_us |
客户端语言,均采用 ISO 639-1 语言代码。 |
page_encoding |
string |
UTF-8 |
网页的文本编码。 |
page_hostname |
string |
example.com |
page_location 的主机名部分。 |
page_location |
string |
https://example.com |
网页的完整文档网址。 |
page_path |
string |
/path/to/page |
page_location 的路径部分。 |
page_referrer |
string |
https://www.google.com |
完整的引荐网页网址,该网址会将用户引荐到事件发生的网页。这不是传入服务器容器的请求上的引荐来源网址标头值。 |
page_title |
string |
Home |
网页的标题。 |
screen_resolution |
string |
1024x768 |
用户设备的总体屏幕分辨率(宽度 x 高度)。 |
user_agent |
string |
|
客户端的用户代理。 |
user_data.email_address |
string |
foo@example.com |
用户的电子邮件地址。 |
user_data.sha256_email_address |
string |
|
经过哈希处理的用户电子邮件地址。了解详情 |
user_data.phone_number |
string |
+15551234567 |
用户的电话号码。 |
user_data.sha256_phone_number |
string |
|
经过哈希处理的用户电话号码。了解详情 |
user_data.address.first_name |
string |
Jane |
用户的名字。 |
user_data.address.sha256_first_name |
string |
|
经过哈希处理的用户名字。了解详情 |
user_data.address.last_name |
string |
Doe |
用户的姓氏。 |
user_data.address.sha256_last_name |
string |
|
经过哈希处理的用户姓氏。了解详情 |
user_data.address.street |
string |
123 Fake St |
用户地址的街道名称和门牌号。 |
user_data.address.city |
string |
城市、城镇 |
用户地址所在的城市。 |
user_data.address.region |
string |
CA |
用户地址所在的州/省/自治区/直辖市或地区。 |
user_data.address.postal_code |
string |
54321 |
用户地址对应的邮政编码。 |
user_data.address.country |
string |
US |
用户地址对应的国家/地区代码。 |
user_id |
string |
|
任意 ID,应该是由网站所有者/库用户提供的已知用户标识符。 |
value |
number |
10 |
与发生的事件相关的货币价值。 |
viewport_size |
string |
725x345 |
内容窗口的尺寸,通常低于屏幕分辨率(宽度 x 高度)。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-02-06。
[null,null,["最后更新时间 (UTC):2024-02-06。"],[[["\u003cp\u003eThis page outlines common event data parameters available across various event types in Google Tag Manager.\u003c/p\u003e\n"],["\u003cp\u003eThese parameters provide information about users, their devices, page details, and event specifics, like currency and value.\u003c/p\u003e\n"],["\u003cp\u003eYou can access event data using the \u003ccode\u003eEvent Data\u003c/code\u003e variable or the \u003ccode\u003egetEventData\u003c/code\u003e API.\u003c/p\u003e\n"],["\u003cp\u003eEvent data can include sensitive information like personally identifiable information (PII) such as email, address, and phone number.\u003c/p\u003e\n"],["\u003cp\u003eFor security and privacy, hashed versions of PII are available, using SHA256 for encryption, in line with Google's data policies.\u003c/p\u003e\n"]]],["Event data, retrievable via the `Event Data` variable or `getEventData` API, includes user, device, and event details. Key parameters are `client_id` (user identifier), `currency`, and `event_name`. Page information like `page_location`, `page_title`, and `page_referrer` is available. User data includes `email_address`, `phone_number`, and address details, with options for hashed versions. Device details include `screen_resolution` and `viewport_size`. Additional fields are `user_agent`, `user_id`, and `value`.\n"],null,["# Common event data\n\nThe following are event data common across different types of events. These\nvalues can be retrieved using the **Event Data** variable or the\n[`getEventData`](/tag-platform/tag-manager/server-side/api#get_event_data) API.\n\n| Parameter | Type | Example | Description |\n|-------------------------------------|----------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| client_id | `string` | ABC_123 | Arbitrary ID that anonymously identifies a particular user, device, or browser instance. |\n| currency | `string` | USD | Currency of the purchase or items associated with the event, in 3-letter ISO_4217 format. |\n| event_name | `string` | purchase | The name of the event. |\n| ip_override | `string` | 1.2.3.4 | The IP address of the user in IPv4 or IPv6 format. |\n| language | `string` | en_us | The language for the client in ISO 639-1. |\n| page_encoding | `string` | UTF-8 | The text encoding of the page. |\n| page_hostname | `string` | example.com | The hostname portion of page_location. |\n| page_location | `string` | https://example.com | The full document URL of the page. |\n| page_path | `string` | /path/to/page | The path portion of page_location. |\n| page_referrer | `string` | https://www.google.com | Full URL of the page that referred to the user to the page where the event occurred. This is not the value of the Referrer header on the request coming into the server container. |\n| page_title | `string` | Home | The title of the page. |\n| screen_resolution | `string` | 1024x768 | Total screen resolution for the user's device. (width by height). |\n| user_agent | `string` | | The client's user agent. |\n| user_data.email_address | `string` | foo@example.com | Email address of the user. |\n| user_data.sha256_email_address | `string` | | Hashed email address of the user. [Learn more](https://support.google.com/google-ads/answer/12785474?sjid=4543074023400780070-NA) |\n| user_data.phone_number | `string` | +15551234567 | Phone number of the user. |\n| user_data.sha256_phone_number | `string` | | Hashed phone number of the user. [Learn more](https://support.google.com/google-ads/answer/12785474?sjid=4543074023400780070-NA) |\n| user_data.address.first_name | `string` | Jane | First name of the user. |\n| user_data.address.sha256_first_name | `string` | | Hashed first name of the user. [Learn more](https://support.google.com/google-ads/answer/12785474?sjid=4543074023400780070-NA) |\n| user_data.address.last_name | `string` | Doe | Last name of the user. |\n| user_data.address.sha256_last_name | `string` | | Hashed last name of the user. [Learn more](https://support.google.com/google-ads/answer/12785474?sjid=4543074023400780070-NA) |\n| user_data.address.street | `string` | 123 Fake St | Street and number for the address of the user. |\n| user_data.address.city | `string` | City Town | City for the address of the user. |\n| user_data.address.region | `string` | CA | State or territory for the address of the user. |\n| user_data.address.postal_code | `string` | 54321 | Postal code for the address of the user. |\n| user_data.address.country | `string` | US | Country code for the address of the user. |\n| user_id | `string` | | Arbitrary ID that is intended to be a known identifier for a user provided by the site owner/library user. |\n| value | `number` | 10 | Monetary value of the event that occurred. |\n| viewport_size | `string` | 725x345 | Size of the content window. Usually smaller than the screen resolution. (width by height). |"]]