How to use the analytics.apiLogView function in analytics

To help you get started, we’ve selected a few analytics examples, based on popular ways it is used in public projects.

github lbryio / lbry-desktop / src / ui / component / viewers / videoViewer.jsx View on Github external
componentDidMount() {
    const { contentType, poster, claim } = this.props;
    const { name, claim_id: claimId, txid, nout } = claim;

    // Quick fix to get file view events on lbry.tv
    // Will need to be changed to include time to start
    analytics.apiLogView(`${name}#${claimId}`, `${txid}:${nout}`, claimId);

    const path = `https://api.lbry.tv/content/claims/${claim.name}/${claim.claim_id}/stream.mp4`;
    const sources = [
      {
        src: path,
        type: contentType,
      },
    ];

    const videoJsOptions = {
      autoplay: true,
      controls: true,
      preload: 'auto',
      poster,
      sources,
      playbackRates: [0.5, 1, 1.25, 1.5, 2],
github lbryio / lbry-desktop / ui / redux / actions / app.js View on Github external
return (dispatch, getState) => {
    const state = getState();
    const { txid, nout, claim_id: claimId } = makeSelectClaimForUri(uri)(state);
    const claimIsMine = makeSelectClaimIsMine(uri)(state);
    const outpoint = `${txid}:${nout}`;

    if (claimIsMine) {
      return Promise.resolve();
    }

    return analytics.apiLogView(uri, outpoint, claimId, timeToStart);
  };
}
github lbryio / lbry-desktop / ui / redux / actions / app.js View on Github external
return (dispatch, getState) => {
    const state = getState();
    const { txid, nout, claim_id: claimId } = makeSelectClaimForUri(uri)(state);
    const claimIsMine = makeSelectClaimIsMine(uri)(state);
    const outpoint = `${txid}:${nout}`;

    if (claimIsMine) {
      return Promise.resolve();
    }

    return analytics.apiLogView(uri, outpoint, claimId, timeToStart);
  };
}