player started event (embedded)

This commit is contained in:
zeppi 2020-11-26 16:06:58 -05:00 committed by Sean Yesmunt
parent adde73605d
commit b736444306
2 changed files with 5 additions and 1 deletions

View file

@ -36,6 +36,7 @@ type Analytics = {
apiSyncTags: ({}) => void,
tagFollowEvent: (string, boolean, ?string) => void,
playerLoadedEvent: (?boolean) => void,
playerStartedEvent: (?boolean) => void,
videoStartEvent: (string, number) => void,
videoBufferEvent: (
StreamClaim,
@ -231,6 +232,9 @@ const analytics: Analytics = {
playerLoadedEvent: embedded => {
sendMatomoEvent('Player', 'Loaded', embedded ? 'embedded' : 'onsite');
},
playerStartedEvent: embedded => {
sendMatomoEvent('Player', 'Started', embedded ? 'embedded' : 'onsite');
},
tagFollowEvent: (tag, following) => {
sendMatomoEvent('Tag', following ? 'Tag-Follow' : 'Tag-Unfollow', tag);
},

View file

@ -100,7 +100,7 @@ function VideoViewer(props: Props) {
const differenceToAdd = Date.now() - desktopPlayStartTime;
timeToStartInMs += differenceToAdd;
}
analytics.playerStartedEvent(embedded);
analytics.videoStartEvent(claimId, timeToStartInMs);
doAnalyticsView(uri, timeToStartInMs).then(() => {
claimRewards();