From db51789e071e3472f2900e9627303fc9235024a8 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 5 May 2020 10:09:53 -0400 Subject: [PATCH] pass time in ms to analytics for view apis --- ui/analytics.js | 2 +- ui/component/viewers/videoViewer/view.jsx | 5 +++-- yarn.lock | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/analytics.js b/ui/analytics.js index 731b52a61..eb04b7540 100644 --- a/ui/analytics.js +++ b/ui/analytics.js @@ -180,7 +180,7 @@ const analytics: Analytics = { } }, videoStartEvent: (claimId, duration) => { - sendGaTimingEvent('Media', 'TimeToStart', Number((duration * 1000).toFixed(0)), claimId); + sendGaTimingEvent('Media', 'TimeToStart', duration, claimId); sendPromMetric('time_to_start', duration); }, videoBufferEvent: (claimId, currentTime) => { diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index f99634f24..66fd8033c 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -85,8 +85,9 @@ function VideoViewer(props: Props) { } function doTrackingFirstPlay(e: Event, data: any) { - analytics.videoStartEvent(claimId, data.secondsToLoad); - doAnalyticsView(uri, data.secondsToLoad).then(() => { + const timeToStartInMs = data.secondsToLoad * 1000; + analytics.videoStartEvent(claimId, timeToStartInMs); + doAnalyticsView(uri, timeToStartInMs).then(() => { claimRewards(); }); } diff --git a/yarn.lock b/yarn.lock index a71f61487..e0603d45b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6178,9 +6178,9 @@ lazy-val@^1.0.4: yargs "^13.2.2" zstd-codec "^0.1.1" -lbry-redux@lbryio/lbry-redux#58ff4d8086cf2d038e0f606f50e04d67efec596a: +lbry-redux@lbryio/lbry-redux#c30e1eee2c16f0b7a70f40dc974edb22a157986b: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/58ff4d8086cf2d038e0f606f50e04d67efec596a" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/c30e1eee2c16f0b7a70f40dc974edb22a157986b" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0"