Real-time behavior log table
Updated at:
Records client-side user behaviors such as impressions, clicks, and purchases. The fields in this table are a subset of the offline behavior table, so the DataHub topic schema matches the MaxCompute table field names.
Field reference
| Field | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | The user ID. |
item_id |
string | Yes | The item ID. |
request_id |
string | No | The request ID. |
event |
string | Yes | The behavior type. Use an English string, such as expr, click, or buy. |
event_time |
bigint | Yes | The time the behavior occurred, as a 10-digit UNIX timestamp in seconds. |
event_value |
double | Yes | A numeric value associated with the behavior, such as viewing duration or purchase amount. Set to 0 if the event has no quantifiable value. |
scene |
string | No | The recommendation scenario, used to distinguish log contexts such as home page feeds, search results, related item recommendations, and leaderboards. Use only English letters, numbers, and underscores — for example, home_feed. |
ip |
string | No | The client IP address, used to derive location features such as country and city. |
device_model |
string | No | The device model, such as iphone5. |
Sample data
The following example shows three behavior events — an impression, a click, and a purchase — in the expected format:
user_id |
item_id |
request_id |
event |
event_time |
event_value |
scene |
ip |
device_model |
|---|---|---|---|---|---|---|---|---|
u001 |
i042 |
req_abc123 |
expr |
1700000001 |
0 |
home_feed |
203.0.113.5 |
iphone5 |
u001 |
i042 |
req_abc123 |
click |
1700000045 |
0 |
home_feed |
203.0.113.5 |
iphone5 |
u001 |
i042 |
req_abc123 |
buy |
1700000120 |
29.99 |
home_feed |
203.0.113.5 |
iphone5 |
event_time must be a 10-digit UNIX timestamp in seconds, not milliseconds.
Is this page helpful?