player loaded analytics event (for embedded/not)

This commit is contained in:
zeppi 2020-11-22 16:33:37 -05:00 committed by Sean Yesmunt
parent c059f3dced
commit adde73605d
2 changed files with 7 additions and 0 deletions

View file

@ -35,6 +35,7 @@ type Analytics = {
apiLogPublish: (ChannelClaim | StreamClaim) => void,
apiSyncTags: ({}) => void,
tagFollowEvent: (string, boolean, ?string) => void,
playerLoadedEvent: (?boolean) => void,
videoStartEvent: (string, number) => void,
videoBufferEvent: (
StreamClaim,
@ -227,6 +228,9 @@ const analytics: Analytics = {
});
}
},
playerLoadedEvent: embedded => {
sendMatomoEvent('Player', 'Loaded', embedded ? 'embedded' : 'onsite');
},
tagFollowEvent: (tag, following) => {
sendMatomoEvent('Tag', following ? 'Tag-Follow' : 'Tag-Unfollow', tag);
},

View file

@ -8,6 +8,7 @@ import ImageViewer from 'component/viewers/imageViewer';
import AppViewer from 'component/viewers/appViewer';
import { withRouter } from 'react-router-dom';
import fs from 'fs';
import analytics from 'analytics';
import DocumentViewer from 'component/viewers/documentViewer';
import PdfViewer from 'component/viewers/pdfViewer';
@ -44,7 +45,9 @@ class FileRender extends React.PureComponent<Props> {
}
componentDidMount() {
const { embedded } = this.props;
window.addEventListener('keydown', this.escapeListener, true);
analytics.playerLoadedEvent(embedded);
}
componentWillUnmount() {