Application Scenario
Object array attributes are mainly used in the following scenarios:
- For example, in the scenario of placing an order to purchase goods, the order contains multiple item details;
- In the scenario of activity reward package, at the end of the activity when receiving the reward, the reward package contains different gift information and quantities;
- In the scenario of favorite song list, specific song information is included in the playlist, such as song name, singer, etc;
- In the scenario of user holding multiple bank cards, the information of the cards, such as the branch bank number, name, region, etc., are included.
The characteristics of the above scenarios are:
- 1:N structure of relationship
In a behavior event, multiple behavior objects will be triggered. The relationship between behavior and behavior object is 1:N, such as the relationship between placing an order and purchased items, distributing rewards and gift information, favorite song list and song information.
- 1:N relationship between multiple entities, such as the relationship between a user and the cards they hold. A user can hold multiple cards, multiple accounts, and multiple products.
- Objects contain multiple detail information
- For example, purchased items contain item details;
- The user holding cards contain card details.
Data format
In the scenario of placing an order to purchase goods, multiple product information purchased in a single order is contained in the order details.
- The order details (order_detail) is an object array attribute that contains four sub-attributes: product name, product amount, product type, and order amount.
- The internal data structure of the object array is a two-dimensional table containing multiple sub-attributes, where each sub-attribute has a corresponding attribute name and data type.
- The object array attribute of order details (order_detail) reports the purchased information of six products contained in the order.
Object array example
"distinct_id": "12345",
"event_name": "pay_order"
"time": 1437280200354,
"order_detail":
[
{"product_name":"iPhone 13", "product_price": 5000, "product_type": "手机", "order_price": 15000},
{"product_name":"switch", "product_price": 2000, "product_type": "游戏", "order_price": 2000},
{"product_name":"macbookpro", "product_price": 9000, "product_type": "电脑", "order_price": 9000},
{"product_name":"iphone 14", "product_price": 6000, "product_type": "手机", "order_price": 6000},
{"product_name":"iPhone 13 Pro", "product_price": 444, "product_type": "手机","order_price": 444 },
{"product_name":"iPhone 13 Pro Max", "product_price": 333, "product_type": "手机", "order_price": 333}
]
Capability description
- In business scenarios, many data that need nested structures to be reported, such as order details, gift package contents, etc., can be solved by supporting object array formats to achieve one event reporting instead of splitting into multiple events and attributes and performing multiple reporting.
- After data reporting is performed through object arrays, the object arrays or sub-attributes within the object arrays can be directly analyzed in terms of analysis indicators, filtering conditions, and grouping.
Analysis Capability Description
Analysis Metrics
- Select object array properties and support statistics of unique values in object arrays.
- Select sub-properties in object arrays.
- If sub-properties are character/time/list/bool types, the statistics of unique values are supported.
- If sub-properties are numeric types, the following calculations are supported: total, average, maximum, minimum, per capita, deduplication, lower quartile, median, upper quartile, P90.
- Total: the sum of sub-property values
- Average: the sum of sub-properties / the number of object arrays
- Maximum, minimum: the maximum and minimum values of sub-properties
- Per capita: the sum of sub-properties / the number of users
- Deduplication: the statistics of unique values in sub-properties
- Quantile: the quantile of sub-properties
Filter
Object array filtering
When selecting object arrays for filtering, the supported filtering conditions are: exists object satisfies, all objects satisfy, no object satisfies, number of contained objects ,is not null, is null.
- The semantics of filtering conditions are:
- Exists object that satisfies: any object in the attribute value satisfies the set filtering condition
- All objects satisfy: all objects in the attribute value satisfy the set condition
- No object satisfies: no objects in the attribute value satisfy the set condition
- Number of contained objects: the number of objects contained in the attribute value
- Is not null: the attribute value is not NULL
- Is null: the attribute value is NULL
Business Scenario Analysis Description
Through this object array, the filtering of the object array is explained.
Object Array Sample
"distinct_id": "12345",
"event_name": "pay_order"
"time": 1437280200354,
"order_detail":
[
{"product_name":"iPhone 13", "product_price": 5000, "product_type": "手机", "order_price": 15000},
{"product_name":"switch", "product_price": 2000, "product_type": "游戏", "order_price": 2000},
{"product_name":"macbookpro", "product_price": 9000, "product_type": "电脑", "order_price": 9000},
{"product_name":"iphone 14", "product_price": 6000, "product_type": "手机", "order_price": 6000},
{"product_name":"iPhone 13 Pro", "product_price": 444, "product_type": "手机","order_price": 444 },
{"product_name":"iPhone 13 Pro Max", "product_price": 333, "product_type": "手机", "order_price": 333}
]
- Case 1: For order details, if there is an object in the array with a product name of "iPhone 13", the filtering condition is met because the object array contains "product_name = “iPhone 13".
- Case 2: For order details, if all objects in the array satisfy the condition that the order amount is greater than 3000, the filtering condition is not met because the order amounts (order_price) in the object array are not all greater than 3000, including 2000, 444, and 333 that are lower than 3000.
- Case 3: For order details, if there is no object in the array with a product type of "food", the filtering condition is met because there is no food type (product_type) in the object array.
- Case 4: For order details, if the number of objects in the array is 6, the filtering condition is met.
Subproperty Filtering
- The subproperty type (STRING, MUMBER, BOOL, DATETIME, LIST) corresponds to the data type for configuring filtering conditions.
If subproperty grouping is not performed for the same object array, the filtering query results of subproperty filtering are consistent with the filtering condition results of "existing objects in the object array" subproperty filtering. As long as any object in the object array satisfies the set filtering condition, the filtering condition is met.
If subproperty grouping is performed for the same object array, such as grouping by product name equal to iPhone13, the query result only contains the subproperty values of the object array whose product name is iPhone13.
Grouping
- Choosing an object array for grouping, the entire object array is displayed to view the metrics, and if the object arrays are identical, the metrics are aggregated.
- If subproperties of the same object array are selected for grouping, the statistics are performed on the values of each subproperty.
Object Array Sample
"distinct_id": "12345",
"event_name": "pay_order"
"time": 1437280200354,
"order_detail":
[
{"product_name":"iPhone 13", "product_price": 5000, "product_type": "手机", "order_price": 15000},
{"product_name":"switch", "product_price": 2000, "product_type": "游戏", "order_price": 2000},
{"product_name":"macbookpro", "product_price": 9000, "product_type": "电脑", "order_price": 9000},
{"product_name":"iphone 14", "product_price": 6000, "product_type": "手机", "order_price": 6000},
{"product_name":"iPhone 13 Pro", "product_price": 444, "product_type": "手机","order_price": 444 },
{"product_name":"iPhone 13 Pro Max", "product_price": 333, "product_type": "手机", "order_price": 333}
]
If product type (product_type) subproperty of the object array is selected to be grouped, the statistics result is
type of merchandise | Order quantity |
---|---|
phone | 4 |
game | 1 |
computer | 1 |
other description
- The following compound query scenario is not supported
A. Grouping without subproperty + subproperty de-duplication/quantile + predefined indicator query (not supported yet)
B, no subproperty group + subproperty de-duplication/quantile + comparison time query (not supported)
C, no subproperty grouping +subproperty de-duplication/quantile + hierarchical view (not supported yet)
D, no subproperty grouping + subproperty de-duplication/quantile + dynamic grouping (not supported yet)
- Subproperties of type List in the analysis model only support List< String> , for example ["Adobe","xyz","0.5"]; The subattribute of DateTime type in the analysis model supports only millisecond timestamps, for example: 1676978198000
- Subproperties Time type Time interval, relative event occurrence time, and relative event occurrence time interval are not supported.
Supported analysis models
Only properties of the object array type can be selected for analysis in event analysis