完成启动图功能强化(数据埋点) https://git.ghzs.com/pm/halo-app-issues/-/issues/1131
This commit is contained in:
@ -19,6 +19,7 @@ import com.gh.gamecenter.entity.CommunityEntity;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.ShareResultEntity;
|
||||
import com.gh.gamecenter.entity.SpecialColumn;
|
||||
import com.gh.gamecenter.entity.StartupAdEntity;
|
||||
import com.gh.gamecenter.manager.UserManager;
|
||||
import com.gh.gamecenter.qa.entity.Questions;
|
||||
import com.gh.gamecenter.retrofit.EmptyResponse;
|
||||
@ -786,4 +787,29 @@ public class LogUtils {
|
||||
}
|
||||
LoghubUtils.log(object, "event", false);
|
||||
}
|
||||
|
||||
public static void logStartAd(String event, StartupAdEntity adEntity) {
|
||||
JSONObject object = new JSONObject();
|
||||
try {
|
||||
object.put("event", event);
|
||||
object.put("timestamp", System.currentTimeMillis() / 1000);
|
||||
object.put("meta", getMetaObject());
|
||||
if (adEntity != null) {
|
||||
object.put("abs_id", adEntity.getId());
|
||||
object.put("abs_text", adEntity.getDesc());
|
||||
if (adEntity.getButton()) {
|
||||
object.put("abs_type", adEntity.getJump().getType());
|
||||
object.put("abs_link", adEntity.getJump().getLink());
|
||||
object.put("abs_link_title", adEntity.getJump().getText());
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
Utils.log("LogUtils->" + object.toString());
|
||||
}
|
||||
LoghubUtils.log(object, "event", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -359,8 +359,14 @@ public class MainActivity extends BaseActivity {
|
||||
adContentTv.setVisibility(View.VISIBLE);
|
||||
if (ad.getButton()) {
|
||||
View btn = findViewById(R.id.adBtn);
|
||||
btn.setOnClickListener((v) -> DirectUtils.directToLinkPage(this, ad.getJump(), "(启动广告)", ""));
|
||||
btn.setOnClickListener((v) -> {
|
||||
DirectUtils.directToLinkPage(this, ad.getJump(), "(启动广告)", "");
|
||||
LogUtils.logStartAd("click_watch_start_ads", ad);
|
||||
});
|
||||
btn.setVisibility(View.VISIBLE);
|
||||
LogUtils.logStartAd("watch_start_ads", ad);
|
||||
} else {
|
||||
LogUtils.logStartAd("start_ads", ad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
package com.gh.gamecenter.entity
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class StartupAdEntity(
|
||||
@SerializedName("_id")
|
||||
val id: String,
|
||||
val desc: String,
|
||||
val button: Boolean,
|
||||
val jump: LinkEntity)
|
||||
Reference in New Issue
Block a user