Commit 47f6e1e8 authored by mengcuiguang's avatar mengcuiguang

优化applog管理类

parent ff335a96
......@@ -20,10 +20,13 @@ import org.json.JSONObject
*/
object CsjAppLogManager {
// 获取方式,穿山甲平台-Adspark-免费广告监测-应用管理创建
const val APP_LOG_ID = "622129"
fun init(application: Application) {
// 第一个参数APPID: 参考2.1节获取
// 第二个参数CHANNEL: 填写渠道信息,请注意不能为空
val config = InitConfig("622129", createChannel())
val config = InitConfig(APP_LOG_ID, createChannel())
// 设置数据上送地址
config.setUriConfig(UriConstants.DEFAULT)
config.isImeiEnable = false //建议关停获取IMEI(出于合规考虑)
......@@ -122,4 +125,64 @@ object CsjAppLogManager {
}
return channel
}
object GrownEventType {
//注册
const val REGISTER = "grown_attribution_event_register"
//付费
const val PURCHASE = "grown_attribution_event_purchase"
//关键行为
const val KEY_BEHAVIOR = "grown_attribution_event_key_behavior"
//下单
const val ORDER = "grown_attribution_event_order"
//下载
const val DOWNLOAD = "grown_attribution_event_download"
//应用内拉起
const val DEEPLINK = "grown_attribution_event_deelink"
//授权
const val AUTHORIZATION = "grown_attribution_event_authorization"
//广告变现
const val AD_PURCHASE = "grown_attribution_event_ad_purchase"
//次留
const val RETENTION_2D = "grown_attribution_event_retention_2d"
//添加购物车
const val ADD_TO_CART = "grown_attribution_event_add_to_cart"
//表单提交
const val FORM_SUBMIT = "grown_attribution_event_form_submit"
//拉活
const val APP_RE_ACTIVE_WAKE_UP = "grown_attribution_event_app_re_active_wake_up"
//自定义激活
const val CUSTOM_ACTIVITION = "grown_attribution_event_custom_activition"
//自定义注册
const val CUSTOM_REGISTER = "grown_attribution_event_custom_register"
}
fun event(v: String) {
//方式一,穿山甲
AppLog.onEventV3(v)
// //方式二,自定义
// val paramsObj = JSONObject()
// try {
// paramsObj.put("key_string", "value_string")
// paramsObj.put("key_int", 10)
// } catch (e: Exception) {
// e.printStackTrace()
// }
// AppLog.onEventV3(GrownEventType.PURCHASE, paramsObj)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment