Commit 0993f164 by 严久程

测评页面埋点事件

parent 50e89e04
...@@ -2,6 +2,8 @@ package com.yidianling.tests.home ...@@ -2,6 +2,8 @@ package com.yidianling.tests.home
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.channel.ydl_flutter_base.base.BaseFlutterActivity import com.channel.ydl_flutter_base.base.BaseFlutterActivity
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.tests.home.config.TestBIConstants
import com.yidianling.tests.home.plugin.TestPlugin import com.yidianling.tests.home.plugin.TestPlugin
import org.json.JSONObject import org.json.JSONObject
...@@ -18,4 +20,9 @@ class NewTestHomeActivity : BaseFlutterActivity() { ...@@ -18,4 +20,9 @@ class NewTestHomeActivity : BaseFlutterActivity() {
override fun initChannelPlugin(jsonObject: JSONObject) { override fun initChannelPlugin(jsonObject: JSONObject) {
TestPlugin.Companion.register(this) TestPlugin.Companion.register(this)
} }
override fun onResume() {
super.onResume()
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_PAGE_VISIT)
}
} }
\ No newline at end of file
package com.yidianling.tests.home.config
/**
* Created by xj on 2019/7/1.
*/
class TestBIConstants {
companion object {
private const val YDL_TEST_MAI_PAGE: String = "test_mai_page|"//壹点灵用户版首页 partId
const val YDL_TEST__MAIN_MY_TEST_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_my_test_click"//cs-我的测评
const val YDL_TEST_MAIN_SEARCH_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_search_click"//cs-测试搜索
const val YDL_TEST_MAIN_RETURN_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_return_click"//cs-返回首页
const val YDL_TEST_MAIN_BANNER_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_banner_click"//cs-banner
const val YDL_TEST_MAIN_ICON_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_icon_click"//cs-icon
const val YDL_TEST_MAIN_SCROLL_BAR_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_scroll_bar_click"//cs-滚动栏
const val YDL_TEST_MAIN_RECOMMEND_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_recommend_click"//cs-推荐
const val YDL_TEST_MAIN_CHANGE_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_change_click"//cs-换一换
const val YDL_TEST_MAIN_FEATURED_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_featured_click"//cs-精选测试
const val YDL_TEST_MAIN_TO_LIST_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_to_list_click"//cs-to列表
const val YDL_TEST_MAIN_VIEW_ALL_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_view_all_click"//cs-查看全部
const val YDL_TEST_MAIN_PAGE_VISIT: String = YDL_TEST_MAI_PAGE + "test_main_page_visit"//cs-页面浏览事件
const val YDL_TEST_MAIN_ALL_TEST_LIST_CLICK: String = YDL_TEST_MAI_PAGE + "test_main_all_test_list_click"//cs-下方所有测试题列表点击
}
}
\ No newline at end of file
...@@ -9,6 +9,8 @@ import com.ydl.ydl_router.manager.YDLRouterManager ...@@ -9,6 +9,8 @@ import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.tests.home.config.TestBIConstants
import com.yidianling.tests.list.view.TestCategoryListActivity import com.yidianling.tests.list.view.TestCategoryListActivity
import com.yidianling.tests.router.TestsIn import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity import com.yidianling.tests.search.TestSearchActivity
...@@ -54,14 +56,17 @@ class TestPlugin : MethodChannel.MethodCallHandler { ...@@ -54,14 +56,17 @@ class TestPlugin : MethodChannel.MethodCallHandler {
override fun onMethodCall(methodCall: MethodCall, result: MethodChannel.Result) { override fun onMethodCall(methodCall: MethodCall, result: MethodChannel.Result) {
when (methodCall.method) { when (methodCall.method) {
GO_BACK -> { GO_BACK -> {
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_RETURN_CLICK)
mActivity?.finish() mActivity?.finish()
} }
GO_SEARCH -> { GO_SEARCH -> {
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_SEARCH_CLICK)
mActivity?.let { mActivity?.let {
TestSearchActivity.start(mActivity!!) TestSearchActivity.start(mActivity!!)
} }
} }
GO_MY_TESTS -> { GO_MY_TESTS -> {
ActionCountUtils.count(TestBIConstants.YDL_TEST__MAIN_MY_TEST_CLICK)
if (!TestsIn.isLogin()) { if (!TestsIn.isLogin()) {
//如果未登录 走登录逻辑 //如果未登录 走登录逻辑
mActivity?.startActivity(TestsIn.loginWayIntent(mActivity!!)) mActivity?.startActivity(TestsIn.loginWayIntent(mActivity!!))
...@@ -73,18 +78,26 @@ class TestPlugin : MethodChannel.MethodCallHandler { ...@@ -73,18 +78,26 @@ class TestPlugin : MethodChannel.MethodCallHandler {
} }
} }
BANNER_CLICK -> { BANNER_CLICK -> {
var linkUrl: String? = methodCall.argument<String>("linkUrl") var linkUrl: String? = methodCall.argument<String>("linkUrl")
linkUrl?.let { linkUrl?.let {
link(linkUrl) link(linkUrl)
} }
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_BANNER_CLICK,linkUrl?:"")
} }
CATEGORY_CLICK -> { CATEGORY_CLICK -> {
mActivity?.let { mActivity?.let {
var tabName: String = methodCall.argument<String>("tabName")?:"" var tabName: String = methodCall.argument<String>("tabName")?:""
TestCategoryListActivity.start(mActivity!!, tabName) TestCategoryListActivity.start(mActivity!!, tabName)
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_ICON_CLICK,tabName)
} }
} }
ADVERT_CLICK -> { ADVERT_CLICK -> {
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_SCROLL_BAR_CLICK)
var linkUrl: String? = methodCall.argument<String>("linkUrl") var linkUrl: String? = methodCall.argument<String>("linkUrl")
linkUrl?.let { linkUrl?.let {
link(linkUrl) link(linkUrl)
...@@ -92,11 +105,15 @@ class TestPlugin : MethodChannel.MethodCallHandler { ...@@ -92,11 +105,15 @@ class TestPlugin : MethodChannel.MethodCallHandler {
} }
TEST_LIST_ITEM_CLICK -> { TEST_LIST_ITEM_CLICK -> {
var linkUrl: String? = methodCall.arguments.toString() var linkUrl: String? = methodCall.arguments.toString()
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_ALL_TEST_LIST_CLICK,linkUrl?:"")
linkUrl?.let { linkUrl?.let {
link(linkUrl) link(linkUrl)
} }
} }
LOOK_ALL_TEST -> { LOOK_ALL_TEST -> {
ActionCountUtils.count(TestBIConstants.YDL_TEST_MAIN_VIEW_ALL_CLICK)
mActivity?.let { mActivity?.let {
TestCategoryListActivity.start(mActivity!!) TestCategoryListActivity.start(mActivity!!)
} }
......
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