All Products
Search
Document Center

Artificial Intelligence Recommendation:Event tracking

Last Updated:Apr 01, 2026

Artificial Intelligence Recommendation (AIRec) trains recommendation models from three types of data: items, users, and behaviors. The "you may also like" service type is suitable for homepage recommendations based on feed streams — it guides users to click and read recommended content, increasing browsing depth and stay duration. For the news feed use case, this page explains what event tracking data AIRec needs and how to collect it correctly.

How it works

AIRec uses three tables for model training:

TableWhat it containsWhy it matters
Item tableItems available for recommendationAIRec selects and ranks candidates from this table
User tableUser profile informationAIRec personalizes results based on user preferences
Behavior tableUser interaction eventsThe core training signal — dirty data directly degrades model quality

Provide valid, clean data in the item table. Invalid items introduce noise and reduce recommendation accuracy.

Client-side vs. server-side tracking

Event tracking responsibilities are split between the client and the server. User-visible interactions (exposures and clicks) must be tracked client-side because only the client knows what the user sees. Item metadata and classification (tags, categories, expiration, status) are tracked server-side because they require feature extraction or system configuration.

Event typeTracked onNotes
ExposuresClient sideDepends on what the user sees on screen
ClicksClient sideDepends on what the user taps or clicks
Scene IDs (behavioral data)Client sideCaptures which scene triggered the interaction
Scene IDs (item data)Server sideRecords which scenes each item belongs to
TagsServer side (or algorithm team)Requires feature extraction from item content
Category levelsServer sideClassifies items by theme and attribute
Expiration timeServer sideConfigured automatically or manually
StatusServer sideConfigured automatically or manually

Event tracking data

Exposures

An exposure is counted each time an item is displayed to a user. The bhv_type field in the behavior table identifies exposures.

Tracking implementation: Client side.

Counting rules:

  • The user must be able to visually see the item.

  • The item must remain visible for a minimum duration (for example, 1 second).

  • If the same item is shown to the same user multiple times in a short period, count only one exposure.

Example — user scrolls quickly through a feed:

1

When a user quickly flicks through the homepage, each item generates one exposure regardless of how many times it scrolls past. Upload six exposure entries to AIRec in total.

Example — user opens an item and returns:

When a user clicks Item C to view its details page and then navigates back to the homepage, items A, B, and C each generate one exposure. Item C generates one click. Upload three exposure entries and one click entry to AIRec.

Clicks

A click is counted each time a user taps or clicks an item to open its details.

Tracking implementation: Client side.

Counting rules:

  • The click must be a valid interaction on the client (not a bot or accidental tap).

  • There is no minimum reading duration after the user opens the item.

  • If the same user clicks the same item multiple times in a short period, count only one click.

Scene IDs

A scene groups items and behaviors into recommendation contexts — for example, a homepage feed, a category page, or a related-articles section. The scene_id field appears in both the item table and the behavior table.

Tracking implementation: Server side for item data; client side for behavioral data.

All scene IDs in which behaviors occur and in which items appear must be recorded and uploaded to AIRec. The scene_id used when recalling items must match the scene_id uploaded to AIRec.

Example:

Three scenes with IDs 1, 2, and 3 are configured in AIRec. Scene IDs are customizable.

Item table entries for scene 2:

item_id: itemA, scene_id: 2
item_id: itemB, scene_id: 2
item_id: itemC, scene_id: 2

Behavior table entries for scene 2:

type: expose, scene_id: 2, item_id: itemA
type: expose, scene_id: 2, item_id: itemB
type: expose, scene_id: 2, item_id: itemC

Usage notes:

  • Scene IDs identify frontend display contexts. They do not represent parent-child hierarchies between scenes.

  • Use categories (not scene IDs) to classify sub-sections within a scene. For example, in a sports channel, sections like "latest scores," "event forecast," and "event commentary" should be modeled as categories, not separate scenes.

  • When querying recommendation results with a server SDK, specify scene_id to retrieve results for a particular scene.

  • Some users have recommendation requirements on a homepage where the homepage does not provide item data based on the interests of users and instead displays item data aggregated in multiple scenes.

Tags

Tags are text labels that summarize the features of an item. The tag field appears in both the user table and the item table. Separate multiple tags with commas (,).

Tracking implementation: Server side, or manually by the algorithm team via feature extraction from item content.

Example:

For an item about a Toyota Highlander SUV, the tag field might contain:

SUV,Toyota,Highlander

Category levels

Category levels classify items that share a theme or attribute. The category_path and category_level fields appear in the item table.

Tracking implementation: Server side.

Example:

11
item_idcategory_pathcategory_level
ASoccer_Chinese Super League2
BBasketball_CBA2
CSoccer_Evergrande2

For information on using category levels to improve recommendation diversity, see Improve diversity with operation rules.

Expiration time

Expiration time marks when an item should no longer be recommended. The expire_time field appears in the item table. When the server time passes the value in expire_time, AIRec stops recommending that item.

Tracking implementation: Server side, configured automatically by system rules or manually.

Usage notes:

  • Leave expire_time blank if the item has no expiration.

  • Specify expire_time as a timestamp accurate to the second.

  • If all items uploaded for the first time have already expired, the service cannot start.

Status

Status controls whether an item is eligible for recommendation. The status field appears in the item table.

ValueMeaning
1Item can be recommended
0Item cannot be recommended

Tracking implementation: Server side, configured automatically by system rules or manually.

Usage notes:

  • The status field is required.

  • If the status value is 0 for all items when data is first uploaded, the service cannot start.

Key concepts

TermDefinition
Feed streamAn information flow that continuously delivers content to users
Browsing depthThe number of page views generated per visit in a calculation cycle
Stay durationThe time a user spends on a page
DiscretizationClassification of data in recommendation results into multiple categories