diff --git a/src/scenes/status/status-item.js b/src/scenes/status/status-item.js index e5de9055..976d6466 100644 --- a/src/scenes/status/status-item.js +++ b/src/scenes/status/status-item.js @@ -9,6 +9,7 @@ import Posology from './posology'; import {canEdit} from './utils/index.js'; import Button from '../../components/RoundButtonIcon'; import Toxic from './toxic'; +import logEvents from '../../services/logEvents'; export default ({navigation, patientState, date}) => { const [customs, setCustoms] = useState([]); @@ -47,6 +48,7 @@ export default ({navigation, patientState, date}) => { const handlePressItem = () => { if (!canEdit(date)) return navigation.navigate('too-late', {date}); + logEvents.logFeelingEditButtonClick(); handleEdit('day-survey'); }; diff --git a/src/scenes/survey/daySurvey.js b/src/scenes/survey/daySurvey.js index 50030d28..fb1bf734 100644 --- a/src/scenes/survey/daySurvey.js +++ b/src/scenes/survey/daySurvey.js @@ -91,6 +91,9 @@ const DaySurvey = ({navigation, route}) => { }; setDiaryData(currentSurvey); logEvents.logFeelingAdd(); + logEvents.logFeelingAddComment( + Object.keys(answers).filter((key) => answers[key].userComment)?.length, + ); if (route.params?.redirect) { alertNoDataYesterday({ diff --git a/src/services/logEvents.js b/src/services/logEvents.js index 0e905063..add2d8b2 100644 --- a/src/services/logEvents.js +++ b/src/services/logEvents.js @@ -133,6 +133,22 @@ const logFeelingAdd = async () => { }); }; +const logFeelingAddComment = async (value) => { + await logEvent({ + category: FEELING, + action: 'FEELING_ADD_COMMENT', + name: 'comment', + value, + }); +}; + +const logFeelingEditButtonClick = async () => { + await logEvent({ + category: FEELING, + action: 'FEELING_EDIT_BUTTON_CLICK', + }); +}; + const PARAMETERS = 'PARAMETERS'; const REMINDER_ADD = 'REMINDER_ADD'; const REMINDER_CANCEL = 'REMINDER_CANCEL'; @@ -439,4 +455,6 @@ export default { logDeleteNoteDiary, logOpenPage, logInputDrugSurvey, + logFeelingEditButtonClick, + logFeelingAddComment, };