Skip to content

Commit

Permalink
Merge pull request getodk#5737 from seadowg/partial-analytics
Browse files Browse the repository at this point in the history
Track partial form submissions
  • Loading branch information
seadowg committed Oct 17, 2023
1 parent 3d66ab1 commit d8fb190
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 @@ -173,4 +173,9 @@ object AnalyticsEvents {
* Tracks how often form-level auto-send setting is used
*/
const val FORM_LEVEL_AUTO_SEND = "FormLevelAutoSend"

/**
* 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 d8fb190

Please sign in to comment.