Skip to content

Commit

Permalink
Add analytics for partial form submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
seadowg committed Sep 29, 2023
1 parent 30a173e commit 316238a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,9 @@ object AnalyticsEvents {
*/
const val PERMISSIONS_DIALOG_CANCEL = "PermissionsDialogCancel"
const val PERMISSIONS_DIALOG_OK = "PermissionsDialogOK"

/**
* Tracks how often a form is finalized using a `ref` attribute on the `submission` element
*/
const val PARTIAL_FORM_FINALIZED = "PartialFormFinalized"
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.json.JSONException;
import org.json.JSONObject;
import org.odk.collect.analytics.Analytics;
import org.odk.collect.android.analytics.AnalyticsEvents;
import org.odk.collect.android.application.Collect;
import org.odk.collect.android.database.instances.DatabaseInstanceColumns;
import org.odk.collect.android.exception.EncryptionException;
Expand Down Expand Up @@ -361,6 +362,10 @@ private Instance exportData(boolean markCompleted, FormSaver.ProgressListener pr
// now see if the packaging of the data for the server would make it
// non-reopenable (e.g., encryption or other fraction of the form).
boolean canEditAfterCompleted = formController.isSubmissionEntireForm();
if (!canEditAfterCompleted) {
Analytics.log(AnalyticsEvents.PARTIAL_FORM_FINALIZED, "form");
}

boolean isEncrypted = false;

// build a submission.xml to hold the data being submitted
Expand Down

0 comments on commit 316238a

Please sign in to comment.