pass time in ms to analytics for view apis

This commit is contained in:
Sean Yesmunt 2020-05-05 10:09:53 -04:00
parent 0f87c8b207
commit db51789e07
3 changed files with 6 additions and 5 deletions

View file

@ -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) => {

View file

@ -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();
});
}

View file

@ -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"