【光环助手V5.3.0】通用链接内容合集-数据埋点 (0924测试 2) https://git.ghzs.com/pm/halo-app-issues/-/issues/1474

This commit is contained in:
juntao
2021-09-26 10:34:13 +08:00
parent 1fabcc756d
commit d51587aa66
8 changed files with 27 additions and 8 deletions

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter.entity
import android.os.Parcelable
import com.gh.common.exposure.ExposureEvent
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
@ -33,5 +34,8 @@ open class LinkEntity(
@SerializedName("added_content_1")
var addedContent1: String = "",
@SerializedName("added_content_2")
var addedContent2: String = ""
var addedContent2: String = "",
// 本地字段 (关联的曝光)
var exposureEvent: ExposureEvent? = null
) : Parcelable

View File

@ -51,7 +51,10 @@ data class SubjectEntity(
// 专题合集,用于首页专题合集-排行榜样式
var columns: MutableList<SubjectEntity> = mutableListOf(),
// 专题背景,用于首页专题合集-排行榜样式
var background: String = ""
var background: String = "",
// 本地字段,用来标记在外部页面中的序号,仅用于曝光记录,具体细节可见 https://git.ghzs.com/pm/halo-app-issues/-/issues/1087
var outerSequence: Int = -1
) : Parcelable {
fun getFilterName(): String {

View File

@ -279,8 +279,15 @@ class GameFragmentAdapter(
private fun bindCommonCollection(holder: CommonCollectionViewHolder, position: Int) {
val commonLinkCollection = mItemDataList[position].commonLinkCollection!!
val blockData = mViewModel.blockData
mItemDataList[position].exposureEventList = arrayListOf()
val clickClosure: (position: Int, linkEntity: LinkEntity) -> Unit = { sequence, linkEntity ->
DirectUtils.directToLinkPage(mContext, linkEntity, "(首页游戏)", "通用链接合集")
DirectUtils.directToLinkPage(
mContext,
linkEntity,
"(首页游戏)",
"通用链接合集",
linkEntity.exposureEvent)
NewLogUtils.logCommonCollectionClick(
commonLinkCollection.id ?: "",
commonLinkCollection.name ?: "",
@ -302,7 +309,8 @@ class GameFragmentAdapter(
"板块内容列表",
blockData?.link ?: "",
blockData?.name ?: "",
clickClosure) { subPosition, linkEntity ->
clickClosure
) { subPosition, linkEntity ->
mItemDataList[position].exposureEventList?.add(
ExposureEvent.createEventWithSourceConcat(
GameEntity(
@ -310,11 +318,11 @@ class GameFragmentAdapter(
name = linkEntity.name
).also {
it.sequence = subPosition
it.outerSequence = position
it.outerSequence = commonLinkCollection.outerSequence
},
mBasicExposureSource,
listOf(ExposureSource("内容合集", commonLinkCollection.name ?: ""))
)
).also { linkEntity.exposureEvent = it }
)
}
}

View File

@ -681,6 +681,7 @@ class GameViewModel(application: Application, var blockData: SubjectRecommendEnt
}
private fun appendAdditionalInfoToSubjectGame(subject: SubjectEntity, outerPosition: Int) {
subject.outerSequence = outerPosition
subject.data?.let {
for ((index, game) in it.withIndex()) {
// 开测表不是专题不需要补充专题 id

View File

@ -182,6 +182,7 @@ class GameDetailViewModel(application: Application,
continue
}
// 处理游戏信息区域
if (item.type == DetailEntity.Type.GAME_INFO.value) {
item.info?.manufacturer = data.mirrorData?.manufacturer ?: ""
item.info?.privacyPolicyUrl = data.mirrorData?.privacyPolicyUrl ?: ""

View File

@ -399,6 +399,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
mSnapshotItemList.add(LegacyHomeSubjectTransformer.getBlankSpacingItem(HomeItemData()) as HomeItemData)
mSnapshotItemList.add(head)
commonCollectionItem.commonCollection = subjectEntity
commonCollectionItem.blockPosition = i
mSnapshotItemList.add(commonCollectionItem)
} else {
val unknown = HomeItemData()

View File

@ -720,7 +720,7 @@ class LegacyHomeFragmentAdapterAssistant(
private fun bindCommonCollection(holder: CommonCollectionViewHolder, item: LegacyHomeItemData) {
val commonCollection = item.commonCollection
val clickClosure: (position: Int, linkEntity: LinkEntity) -> Unit = { sequence, linkEntity ->
DirectUtils.directToLinkPage(mContext, linkEntity, "(首页游戏)", "通用链接合集")
DirectUtils.directToLinkPage(mContext, linkEntity, "(首页游戏)", "通用链接合集", linkEntity.exposureEvent)
NewLogUtils.logCommonCollectionClick(
commonCollection?.id ?: "",
commonCollection?.name ?: "",
@ -755,7 +755,7 @@ class LegacyHomeFragmentAdapterAssistant(
},
mBasicExposureSources,
listOf(ExposureSource("内容合集", commonCollection.name ?: ""))
)
).also { linkEntity.exposureEvent = it }
)
}
}

View File

@ -189,6 +189,7 @@ object LegacyHomeSubjectTransformer {
}
private fun appendAdditionalInfoToSubjectGame(subject: SubjectEntity, outerPosition: Int) {
subject.outerSequence = outerPosition
subject.data?.let {
for ((index, game) in it.withIndex()) {
if (subject.tag != "test") {