public class ThinkingDataAnalytics extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ThinkingDataAnalytics.BatchConsumer |
static class |
ThinkingDataAnalytics.DebugConsumer |
static class |
ThinkingDataAnalytics.LoggerConsumer
LoggerConsumer 批量实时写本地文件,文件以天为分隔,需要搭配 LogBus 进行上传.
|
| Constructor and Description |
|---|
ThinkingDataAnalytics(Consumer consumer)
构造函数.
|
ThinkingDataAnalytics(Consumer consumer,
boolean enableUUID) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearSuperProperties()
清除公共事件属性
|
void |
close()
关闭并退出 sdk 所有线程,停止前会清空所有本地数据
|
void |
flush()
立即上报数据到接收端
|
void |
setDynamicSuperPropertiesTracker(DynamicSuperPropertiesTracker dynamicSuperPropertiesTracker)
设置动态公共属性,即此处设置的公共属性会在上报时获取值
建议此回调方法中不要加入大量计算操作代码
|
void |
setSuperProperties(Map<String,Object> properties)
设置公共事件属性.
|
void |
track_first(String accountId,
String distinctId,
String eventName,
Map<String,Object> properties)
首次事件
|
void |
track_overwrite(String accountId,
String distinctId,
String eventName,
String eventId,
Map<String,Object> properties) |
void |
track_update(String accountId,
String distinctId,
String eventName,
String eventId,
Map<String,Object> properties) |
void |
track(String accountId,
String distinctId,
String eventName,
Map<String,Object> properties)
上报事件
|
void |
user_add(String accountId,
String distinctId,
Map<String,Object> properties)
用户属性修改,只支持数字属性增加的接口
|
void |
user_append(String accountId,
String distinctId,
Map<String,Object> properties)
用户的数组类型的属性追加
|
void |
user_del(String accountId,
String distinctId)
删除用户,此操作不可逆
|
void |
user_set(String accountId,
String distinctId,
Map<String,Object> properties)
设置用户属性.
|
void |
user_setOnce(String accountId,
String distinctId,
Map<String,Object> properties)
设置用户属性.
|
void |
user_uniqAppend(String accountId,
String distinctId,
Map<String,Object> properties)
用户的数组类型的属性去重追加
|
void |
user_unset(String accountId,
String distinctId,
String... properties)
删除用户指定的属性
|
public ThinkingDataAnalytics(Consumer consumer)
consumer - BatchConsumer, LoggerConsumer 等public ThinkingDataAnalytics(Consumer consumer, boolean enableUUID)
public void user_del(String accountId, String distinctId) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDInvalidArgumentException - 数据错误public void user_add(String accountId, String distinctId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDproperties - 用户属性InvalidArgumentException - 数据错误public void user_setOnce(String accountId, String distinctId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDproperties - 用户属性InvalidArgumentException - 数据错误public void user_set(String accountId, String distinctId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDproperties - 用户属性InvalidArgumentException - 数据错误public void user_unset(String accountId, String distinctId, String... properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDproperties - 用户属性InvalidArgumentException - 数据错误public void user_append(String accountId, String distinctId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDproperties - 用户属性InvalidArgumentException - 数据错误public void user_uniqAppend(String accountId, String distinctId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客 IDproperties - 用户属性InvalidArgumentException - 数据错误public void track(String accountId, String distinctId, String eventName, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客IDeventName - 事件名称properties - 事件属性InvalidArgumentException - 数据错误public void track_first(String accountId, String distinctId, String eventName, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号IDdistinctId - 访客IDeventName - 事件名称properties - 事件属性
(必须要在properties中设置#first_check_id字段,该字段是校验首次事件的标识ID)InvalidArgumentException - 数据错误public void track_update(String accountId, String distinctId, String eventName, String eventId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客IDeventName - 事件名称eventId - 事件IDproperties - 事件属性InvalidArgumentException - 数据错误public void track_overwrite(String accountId, String distinctId, String eventName, String eventId, Map<String,Object> properties) throws InvalidArgumentException
accountId - 账号 IDdistinctId - 访客IDeventName - 事件IDeventId - 事件IDproperties - 事件属性InvalidArgumentException - 数据错误public void clearSuperProperties()
public void setSuperProperties(Map<String,Object> properties)
properties - 公共属性public void setDynamicSuperPropertiesTracker(DynamicSuperPropertiesTracker dynamicSuperPropertiesTracker)
dynamicSuperPropertiesTracker - 动态公共属性public void flush()
public void close()
Copyright © 2022. All rights reserved.