add a new event to Analytics (select_answer)

This commit is contained in:
Dawid Wysokiński 2021-04-13 06:17:55 +02:00
parent 94db044f85
commit 85bc459351
2 changed files with 7 additions and 0 deletions

View File

@ -3,4 +3,5 @@ export enum Event {
UnSaveQualification = 'unsave_qualification',
StartTest = 'start_test',
FinishTest = 'finish_test',
SelectAnswer = 'select_answer',
}

View File

@ -40,6 +40,12 @@ const Test = ({ questions, onReset, qualification }: TestProps) => {
index === index2 ? answer : otherAnswer,
),
);
analytics().logEvent(Event.SelectAnswer, {
qualificationID: analyticsParams.qualificationID,
questionID: questions[index].id.toString(),
answer,
correct: questions[index].correctAnswer === answer ? '1' : '0',
});
};
const handleFinishTest = () => {