Add Google Analytics
This commit is contained in:
@@ -298,6 +298,16 @@ export default withRouter(class Progress extends React.Component {
|
||||
loading: false,
|
||||
canProceed: true,
|
||||
};
|
||||
|
||||
if (data.correct) {
|
||||
this.props.logEvent("correct_answer", {
|
||||
progress_id: this.props.match.params.progressId,
|
||||
});
|
||||
} else {
|
||||
this.props.logEvent("incorrect_answer", {
|
||||
progress_id: this.props.match.params.progressId,
|
||||
});
|
||||
}
|
||||
|
||||
if (data.correct && !data.moreAnswers && this.state.incorrectAnswers[data.currentVocabId]) {
|
||||
// all answers to question given correctly
|
||||
@@ -322,6 +332,10 @@ export default withRouter(class Progress extends React.Component {
|
||||
// test done
|
||||
newState.duration = data.duration;
|
||||
|
||||
this.props.logEvent("test_complete", {
|
||||
progress_id: this.props.match.params.progressId,
|
||||
});
|
||||
|
||||
promises.push(this.state.db.collection("progress")
|
||||
.where("uid", "==", this.state.user.uid)
|
||||
.where("setIds", "==", this.state.setIds)
|
||||
|
||||
Reference in New Issue
Block a user