等待中
import Percept
let config = PerceptConfig(apiKey: apiKey)
Percept.shared.setup(config)
let config = PerceptConfig(apiKey: apiKey)
config.captureAppLifecycleEvents = false
config.debug = true
// .. and more
Percept.shared.capture("Add To Cart", properties: ["item_name": "product name"])
Percept.shared.setUserId("testUser", withPerceptUserProps: [PerceptUserProperty.NAME: "John Doe"], additionalProps: ["isVerified": false])
我们在PerceptUserProperty
中暴露了一些默认用户属性键。请使用它们,因为这有助于标准化并使用Percept提供的Engage功能。
您也可以通过调用setCurrentUserProperties
方法在设置用户ID之后设置用户属性。
Percept.shared.setCurrentUserProperties(withPerceptUserProps: [PerceptUserProperty.NAME: "John Doe"], additionalProps: ["isVerified": false])
Percept.shared.setGlobalProperties(["tenant": "percept"])
Percept.shared.getGlobalProperties(["tenant": "percept"])
Percept.shared.removeGlobalProperty("tenant")
这将清除所有用户信息和缓存数据。在注销时调用clear函数以删除所有与用户相关的信息
Percept.shared.clear()
Percept.shared.close()