xugenyuan

ref |> 增加几处埋点

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 "wdKit": "file:../../commons/wdKit", 13 "wdKit": "file:../../commons/wdKit",
14 "wdBean": "file:../../features/wdBean", 14 "wdBean": "file:../../features/wdBean",
15 "wdRouter": "file:../../commons/wdRouter", 15 "wdRouter": "file:../../commons/wdRouter",
  16 + "wdTracking": "file:../../features/wdTracking",
16 "wdNetwork": "file:../../commons/wdNetwork" 17 "wdNetwork": "file:../../commons/wdNetwork"
17 } 18 }
18 } 19 }
@@ -11,6 +11,7 @@ import { notificationManager } from '@kit.NotificationKit'; @@ -11,6 +11,7 @@ import { notificationManager } from '@kit.NotificationKit';
11 import { BusinessError } from '@kit.BasicServicesKit'; 11 import { BusinessError } from '@kit.BasicServicesKit';
12 import { SpConstants } from 'wdConstant/Index'; 12 import { SpConstants } from 'wdConstant/Index';
13 import { PushContentBean, PushContentParser } from './PushContentParser'; 13 import { PushContentBean, PushContentParser } from './PushContentParser';
  14 +import { ParamType, Tracking } from 'wdTracking/Index';
14 15
15 const TAG = "GetuiPush" 16 const TAG = "GetuiPush"
16 17
@@ -220,6 +221,15 @@ export class GetuiPush { @@ -220,6 +221,15 @@ export class GetuiPush {
220 this.lastPushContent = undefined 221 this.lastPushContent = undefined
221 } 222 }
222 223
  224 + private trackingClick(content: PushContentBean) {
  225 + let param: ParamType = {
  226 + "pushResourceId": "",
  227 + "pushTitle": content.notifyTitle || "",
  228 + "pushContent": content.notifyContent || "",
  229 + }
  230 + Tracking.event("push_click", param)
  231 + }
  232 +
223 private dealWithCmdMessage(result: GTCmdMessage) { 233 private dealWithCmdMessage(result: GTCmdMessage) {
224 let action: Number = result.action; 234 let action: Number = result.action;
225 if (action === PushConst.BIND_ALIAS_RESULT) { 235 if (action === PushConst.BIND_ALIAS_RESULT) {
@@ -9,6 +9,8 @@ export interface PushContentBean { @@ -9,6 +9,8 @@ export interface PushContentBean {
9 want?: Want // want参数 (用来在消费时,回执) 9 want?: Want // want参数 (用来在消费时,回执)
10 online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道) 10 online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道)
11 pushLink?: string // 解析want,对应pushLink参数 11 pushLink?: string // 解析want,对应pushLink参数
  12 + notifyTitle?: string
  13 + notifyContent?: string
12 } 14 }
13 15
14 /* 16 /*
@@ -66,7 +68,9 @@ export class PushContentParser { @@ -66,7 +68,9 @@ export class PushContentParser {
66 if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { 68 if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
67 let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string 69 let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
68 return { 70 return {
69 - isPush: true, online: true, pushLink: pushLink, want: want 71 + isPush: true, online: true, pushLink: pushLink, want: want,
  72 + notifyTitle: gtData["title"] as string,
  73 + notifyContent: gtData["content"] as string,
70 } 74 }
71 } 75 }
72 } 76 }
@@ -105,7 +109,9 @@ export class PushContentParser { @@ -105,7 +109,9 @@ export class PushContentParser {
105 if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { 109 if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
106 let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string 110 let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
107 return { 111 return {
108 - isPush: true, online: false, pushLink: pushLink, want: want 112 + isPush: true, online: false, pushLink: pushLink, want: want,
  113 + notifyTitle: want.parameters["title"] as string,
  114 + notifyContent: want.parameters["content"] as string,
109 } 115 }
110 } 116 }
111 } 117 }
@@ -6,6 +6,7 @@ import { BusinessError } from '@kit.BasicServicesKit' @@ -6,6 +6,7 @@ import { BusinessError } from '@kit.BasicServicesKit'
6 import { Logger, ToastUtils, CustomToast, EmitterUtils, EmitterEventId } from 'wdKit/Index' 6 import { Logger, ToastUtils, CustomToast, EmitterUtils, EmitterEventId } from 'wdKit/Index'
7 import { LoginViewModel } from './LoginViewModel' 7 import { LoginViewModel } from './LoginViewModel'
8 import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' 8 import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
  9 +import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'
9 10
10 const TAG = "OneKeyLoginPage" 11 const TAG = "OneKeyLoginPage"
11 12
@@ -28,10 +29,23 @@ struct OneKeyLoginPage { @@ -28,10 +29,23 @@ struct OneKeyLoginPage {
28 maskColor:"#00000000" 29 maskColor:"#00000000"
29 }) 30 })
30 31
  32 + // 埋点计算页面浏览时长
  33 + private pageStartDate: number = 0
  34 + private pageName = TrackConstants.PageName.OneClick_Login
  35 +
31 aboutToAppear(): void { 36 aboutToAppear(): void {
32 this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" 37 this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||""
33 } 38 }
34 39
  40 + onPageShow(): void {
  41 + this.pageStartDate = Date.now()
  42 + }
  43 +
  44 + onPageHide(): void {
  45 + const duration = (Date.now() - this.pageStartDate!)
  46 + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration)
  47 + }
  48 +
35 build() { 49 build() {
36 Column() { 50 Column() {
37 this.CloseRow() 51 this.CloseRow()
@@ -68,6 +82,8 @@ struct OneKeyLoginPage { @@ -68,6 +82,8 @@ struct OneKeyLoginPage {
68 if (!this.agreeProtocol) { 82 if (!this.agreeProtocol) {
69 return 83 return
70 } 84 }
  85 +
  86 + TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName)
71 this.requestLogin() 87 this.requestLogin()
72 }) 88 })
73 } 89 }
1 import { DeviceUtil, DisplayUtils, UpgradeTipContent } from 'wdKit/Index' 1 import { DeviceUtil, DisplayUtils, UpgradeTipContent } from 'wdKit/Index'
  2 +import { TrackConstants, TrackingButton } from 'wdTracking/Index'
2 3
3 @Preview 4 @Preview
4 @CustomDialog 5 @CustomDialog
@@ -35,6 +36,8 @@ export struct UpgradeTipDialog { @@ -35,6 +36,8 @@ export struct UpgradeTipDialog {
35 .margin({top: 24}) 36 .margin({top: 24})
36 .onClick(() => { 37 .onClick(() => {
37 this.controller.close() 38 this.controller.close()
  39 +
  40 + TrackingButton.click("notUpdatedTemporarily", TrackConstants.PageName.Update, TrackConstants.PageName.Update)
38 if (this.cancel) { 41 if (this.cancel) {
39 this.cancel() 42 this.cancel()
40 } 43 }
@@ -88,6 +91,8 @@ export struct UpgradeTipDialog { @@ -88,6 +91,8 @@ export struct UpgradeTipDialog {
88 }) 91 })
89 .onClick(() => { 92 .onClick(() => {
90 this.controller.close() 93 this.controller.close()
  94 +
  95 + TrackingButton.click("immediateUpdating", TrackConstants.PageName.Update, TrackConstants.PageName.Update)
91 if (this.confirm) { 96 if (this.confirm) {
92 this.confirm() 97 this.confirm()
93 } 98 }