Showing
2 changed files
with
3 additions
and
3 deletions
| @@ -69,7 +69,7 @@ struct OneKeyLoginPage { | @@ -69,7 +69,7 @@ struct OneKeyLoginPage { | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | onPageHide(): void { | 71 | onPageHide(): void { |
| 72 | - const duration = (Date.now() - this.pageStartDate!) | 72 | + const duration = Math.floor((Date.now() - this.pageStartDate!)/1000) |
| 73 | TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration) | 73 | TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration) |
| 74 | } | 74 | } |
| 75 | 75 |
| @@ -6,7 +6,7 @@ import { Tracking } from './Tracking' | @@ -6,7 +6,7 @@ import { Tracking } from './Tracking' | ||
| 6 | export class TrackingPageBrowse { | 6 | export class TrackingPageBrowse { |
| 7 | 7 | ||
| 8 | /// 页面浏览事件 | 8 | /// 页面浏览事件 |
| 9 | - // duration 浏览时长,上层计算,单位毫秒 | 9 | + // duration 浏览时长,上层计算,单位秒 |
| 10 | static trackCommonPageExposureEnd(pageId: string, pageName: string, duration: number ,extParams?: ParamType) { | 10 | static trackCommonPageExposureEnd(pageId: string, pageName: string, duration: number ,extParams?: ParamType) { |
| 11 | let params = TrackingUtils.generateParams(extParams) | 11 | let params = TrackingUtils.generateParams(extParams) |
| 12 | if (pageId.length) { | 12 | if (pageId.length) { |
| @@ -16,7 +16,7 @@ export class TrackingPageBrowse { | @@ -16,7 +16,7 @@ export class TrackingPageBrowse { | ||
| 16 | params["pageName"] = pageName | 16 | params["pageName"] = pageName |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | - params["duration"] = duration / 1000 | 19 | + params["duration"] = duration |
| 20 | params["action"] = TrackConstants.ActionType.Browse | 20 | params["action"] = TrackConstants.ActionType.Browse |
| 21 | TrackingUtils.fillPositionWith(params) | 21 | TrackingUtils.fillPositionWith(params) |
| 22 | Tracking.event("channel_exposure", params) | 22 | Tracking.event("channel_exposure", params) |
-
Please register or login to post a comment