diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx index 79a85c9dc786d9775863679a7395d7564b09a478..ed2ec178587147662aa9e666f617d80ee2ae39cb 100644 --- a/src/containers/gui.jsx +++ b/src/containers/gui.jsx @@ -65,7 +65,10 @@ class GUI extends React.Component { this.props.vm.stopAll(); } render () { - if (this.state.loadingError) throw new Error(`Failed to load project: ${this.state.errorMessage}`); + if (this.state.loadingError) { + throw new Error( + `Failed to load project from server [id=${window.location.hash}]: ${this.state.errorMessage}`); + } const { children, fetchingProject, diff --git a/src/containers/project-loader.jsx b/src/containers/project-loader.jsx index 80ef161ea291d8fbb87e77d203fb314e187d725b..7f178b6232416aca90e22d35c36c56af7c53ba92 100644 --- a/src/containers/project-loader.jsx +++ b/src/containers/project-loader.jsx @@ -3,6 +3,8 @@ import PropTypes from 'prop-types'; import React from 'react'; import {connect} from 'react-redux'; +import analytics from '../lib/analytics'; + import { openLoadingProject, closeLoadingProject @@ -45,6 +47,11 @@ class ProjectLoader extends React.Component { const thisFileInput = e.target; reader.onload = () => this.props.vm.loadProject(reader.result) .then(() => { + analytics.event({ + category: 'project', + action: 'Import Project File', + nonInteraction: true + }); this.props.closeLoadingState(); // Reset the file input after project is loaded // This is necessary in case the user wants to reload a project @@ -76,7 +83,10 @@ class ProjectLoader extends React.Component { ); } render () { - if (this.state.loadingError) throw new Error(`Failed to load project: ${this.state.errorMessage}`); + if (this.state.loadingError) { + throw new Error( + `Failed to load project from file: ${this.state.errorMessage}`); + } const { /* eslint-disable no-unused-vars */ children, diff --git a/src/lib/project-loader-hoc.jsx b/src/lib/project-loader-hoc.jsx index 5735e72957b3f399c76ab80979b408b8d7c6e2b5..cb8501af42ab532cb153a6a68efbbec185adf682 100644 --- a/src/lib/project-loader-hoc.jsx +++ b/src/lib/project-loader-hoc.jsx @@ -44,7 +44,7 @@ const ProjectLoaderHOC = function (WrappedComponent) { analytics.event({ category: 'project', action: 'Load Project', - value: projectId, + label: projectId, nonInteraction: true }); }