integrationlatest接入文档 / 实时调试
实时调试
注意
SDK Debug 模式仅供接入调试时使用,严禁应用在生产环境。
开启日志打印
ThinkingData::set_enable_log(true)
Debug 模式验证数据有效性
在SDK接入过程中,您可以通过使用AE的Debug功能,进行实时调试。使用Debug功能需要如下两步操作:
- 使用TDDebugConsumer
以下使用TDDebugConsumer的示例代码:
consumer = ThinkingData::TDDebugConsumer.new('SERVER_URL', 'APPID', device_id: "123456789")
ta = ThinkingData::TDAnalytics.new(consumer)
DEMO_ACCOUNT_ID = '123'
DEMO_DISTINCT_ID = 'aaa'
properties = {
array: ["str1", "11", Time.now, "2020-02-11 17:02:52.415"],
prop_date: Time.now,
prop_double: 134.1,
prop_string: 'hello world',
prop_bool: true,
}
ta.track(event_name: 'test_event', distinct_id: DEMO_DISTINCT_ID, account_id: DEMO_ACCOUNT_ID, properties: properties)
Debug 模式可能会影响数据采集质量和 App 的稳定性,只用于集成阶段数据验证,不要在线上环境使用。
这篇文档对你有帮助吗?

