Active and passive events are behavioral descriptions based on the user's active initiation and passive influence. In certain business scenarios, a user may be both the initiator of an action and the recipient who is affected by it. The behavior triggered by the initiator is called an "active event," while the behavior affecting the recipient is called a "passive event." When an active event and a passive event correspond to each other and appear as a pair, they are referred to as a "relational event."
More scenarios: Like and be liked, comment and be commented, complain and be complained about, share content and receive content, and so on.
Scenario description: The system pushed notifications to users, customer service sent a coupon to a user during complaint resolution, or a program triggered a message sent to a user.
Because active and passive events are based on the user, there is no active event in this scenario, as the action is not initiated by the user. The user is the recipient of the action and is passively affected, so only passive events exist.
Passive event: The user received a notification / the user received a coupon / the user received a push message.
In the scenario where users mutually follow each other, the relationship events are shown in the table below.
Event ID | Event name | User ID | Target object ID | Initiator object ID | Passive | Relationship | Semantics |
|---|---|---|---|---|---|---|---|
1 | subscribe | A | B | null | No | Yes | A follows B |
2 | $inactive_subscribe | B | null | A | Yes | Yes | B is followed by A |
3 | subscribe | B | A | null | No | No | B follows A |
To calculate the proportion of follow-backs, passive events are required. The funnel is constructed as follows:
Step 1: $inactive_subscribe, associate the initiator object ID.
Step 2: subscribe, associate the target object ID (since list-type associated attributes are not currently supported, users need to report a target object ID themselves in this scenario).
Other condition: group by user ID.
Compared with active events, relationship events and passive events have additional preset attributes for differentiation. The main differences are shown in the table below:
Event name | Preset attribute | Display name | Preset attribute type | Value description | |
|---|---|---|---|---|---|
Active event (relationship) | event_name | $target_uuid_list | Passive event UUID | list | Manually report user ID |
$inline | Whether it is a relationship event | string | true or any other value | ||
Passive event (relationship) | $inactive_{event_name} | $inactive | Whether it is a passive event | string | true or any other value |
$inline | Whether it is a relationship event | string | true or any other value | ||
$source_uuid | Active event UUID | string | UUID of the corresponding relationship event | ||
Passive event (manual) | Custom | $inactive | Whether it is a passive event | string | true or any other value |
When users mark the current event as a relationship event (with $inline set to "true") in an active event, the system will automatically generate the corresponding passive event. The system-generated passive event will have an additional preset attribute: "$source_uuid", which is the uuid of the user who triggered the active event.
The $inactive attribute of a passive event has a value of true. Note that the data type of this attribute is currently string, not boolean.
When reporting a relationship event, the system will automatically generate a passive event. The system-generated passive event will not only have the above preset attributes, but will also include the $inline = "true" and $source_uuid (with the value being the corresponding active event uuid) attributes. In addition, the event name will automatically have the "$inactive_" prefix added.
Passive events are included by default when calculating event consumption, but are not included when calculating MAU and DAU. Disabled passive events will also not generate consumption.
Yes. $target_uuid_list is a list attribute and supports passing multiple uuids. The system will automatically generate a corresponding passive event for each user affected by the event.
We provide a method to automatically generate the corresponding passive event when a user triggers an active event.
To distinguish between active and passive events, we have added the public event property $inactive. When $inactive is true, the corresponding event is a passive event.
Attribute name | Data type | Value range |
|---|---|---|
$inactive | string | "true" Passive event. |
Sample code: "Relationship event"
new ActionButton ( "关联事件", // which means "related events" new Action () { @Override public void doAction () { JSONObject param = new JSONObject (); try { param.put ( "video_id", Generator.getRandomNum ( 0, 10000000 ) ); param.put ( "category", "主动被动事件" ); // which means "active passive events" param.put ( "author_id", Generator.getRandomNum ( 0, 10000 ) ); param.put ( "$inline", "true" ); JSONArray uuid_list = new JSONArray (); for (int i = 0; i < Generator.getRandomNum ( 0, 10 ); i++) { uuid_list.put ( Generator.getRandomNum ( 10000, 99999 ) ); } param.put ( "$target_uuid_list", uuid_list ); } catch (JSONException e) { e.printStackTrace (); } AppLog.onEventV3 ( "like", param ); } } )
Sample code: "Passive event"
new ActionButton ( "被动事件", // which means "passive events" new Action () { @Override public void doAction () { JSONObject param = new JSONObject (); try { param.put ( "video_id", Generator.getRandomNum ( 0, 10000000 ) ); param.put ( "category", "主动被动事件" ); // which means "active passive events" param.put ( "author_id", Generator.getRandomNum ( 0, 10000 ) ); param.put ( "$inactive", "true" ); } catch (JSONException e) { e.printStackTrace (); } AppLog.onEventV3 ( "like", param ); } } )
[BDAutoTrack eventV3:@"like" params:@{ @"video_title": @"Lady Gaga on Oscar", @"category" : @"主动被动事件", // which means "active passive events" @"$inactive" : @"false" }];
Sample code: "Relationship event"
[BDAutoTrack eventV3:@"like" params:@{ @"video_title": @"Lady Gaga on Oscar", @"category" : @"主动被动事件", // which means "active passive events" @"$inactive" : @"true", @"$inline": @"true", @"$target_uuid_list" : @[@"123", @"456", @"789"] }];
Sample code: "Passive event"
[BDAutoTrack eventV3:@"like" params:@{ @"video_title": @"Lady Gaga on Oscar", @"category" : @"主动被动事件", // which means "active passive events" @"$inactive" : @"true" }];
window.collectEvent('like', { from: "index", category: "主动被动事件", // which means "active passive events" $inactive: "false" });
Sample code: "Relationship event"
window.collectEvent('like', { from: "index", category: "主动被动事件", // which means "active passive events" $inactive: "true" , $inline: "true", $target_uuid_list: ["123","456","789"] });
Sample code: "Passive event"
window.collectEvent('like', { from: "index", category: "主动被动事件", // which means "active passive events" $inactive: "true" , });
app.$$Rangers.event('like', { from: "index", category: "主动被动事件", // which means "active passive events" $inactive: "false", })
Sample code: "Relationship event"
app.$$Rangers.event('like', { from: "index", category: "主动被动事件", // which means "active passive events" $inactive: "true" , $inline: "true", $target_uuid_list: ["123","456","789"] });
Sample code: "Passive event"
app.$$Rangers.event('like', { from: "index", category: "主动被动事件", // which means "active passive events" $inactive: "true" });
{ "user": { // It is recommended to first report the user_unique_id of the user on the client side, and then use it on the server side "user_unique_id": " 74481585297" //User unique identifier }, "header": { "app_channel": "App Store" //App channel }, "events": [ { "event": "like", //event name "params": "{ \"category\":\"主动被动事件\", // which means "active passive events" \"$inactive\":\"false\" }", //event attributes "local_time_ms": 1489573628001 //The timestamp of the event occurrence } ] }
Sample code: "Relationship event"
{ "user": { // It is recommended to first report the user_unique_id of the user on the client side, and then use it on the server side "user_unique_id": " 74481585297" //User unique identifier }, "header": { "app_channel": "App Store" //App channel }, "events": [ { "event": "like", //event name "params": "{ \"category\":\"主动被动事件\", // which means "active passive events" \"$inactive\":\"true\", \\"$inline\\":\\"true\\", \"$target_uuid_list\":[\"123\",\"456\",\"789\"] }", //event attributes "local_time_ms": 1489573628001 //The timestamp of the event occurrence } ] }
Sample code: "Passive event"
{ "user": { // It is recommended to first report the user_unique_id of the user on the client side, and then use it on the server side "user_unique_id": " 74481585297" //User unique identifier }, "header": { "app_channel": "App Store" //App channel }, "events": [ { "event": "like", //event name "params": "{ \"category\":\"主动被动事件\", // which means "active passive events" \"$inactive\":\"true\" }", //event attributes "local_time_ms": 1489573628001 //The timestamp of the event occurrence } ] }