Skip to content

Commit 03ea4ab

Browse files
committed
Add visual editor events to mixpanel and nosara trackers
1 parent baa34d5 commit 03ea4ab

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerMixpanel.java

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,45 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
403403
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_saved_draft");
404404
instructions.setCurrentDateForPeopleProperty("last_time_saved_draft");
405405
break;
406+
case EDITOR_DISCARDED_CHANGES:
407+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
408+
mixpanelInstructionsForEventName("Editor - Discarded Changes");
409+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_discarded_changes");
410+
instructions.setCurrentDateForPeopleProperty("last_time_discarded_changes");
411+
break;
412+
case EDITOR_EDITED_IMAGE:
413+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
414+
mixpanelInstructionsForEventName("Editor - Edited Image");
415+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_edited_image");
416+
instructions.setCurrentDateForPeopleProperty("last_time_edited_image");
417+
break;
418+
case EDITOR_ENABLED_NEW_VERSION:
419+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
420+
mixpanelInstructionsForEventName("Editor - Enabled New Version");
421+
instructions.addSuperPropertyToFlag("enabled_new_editor");
422+
break;
423+
case EDITOR_TOGGLED_ON:
424+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
425+
mixpanelInstructionsForEventName("Editor - Toggled New Editor On");
426+
instructions.setPeoplePropertyToValue("enabled_new_editor", true);
427+
break;
428+
case EDITOR_TOGGLED_OFF:
429+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
430+
mixpanelInstructionsForEventName("Editor - Toggled New Editor Off");
431+
instructions.setPeoplePropertyToValue("enabled_new_editor", true);
432+
break;
433+
case EDITOR_UPDLOAD_MEDIA_FAILED:
434+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
435+
mixpanelInstructionsForEventName("Editor - Upload Media Failed");
436+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_upload_media_failed");
437+
instructions.setCurrentDateForPeopleProperty("last_time_editor_upload_media_failed");
438+
break;
439+
case EDITOR_UPDLOAD_MEDIA_RETRIED:
440+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
441+
mixpanelInstructionsForEventName("Editor - Retried Uploading Media");
442+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_retried_uploading_media");
443+
instructions.setCurrentDateForPeopleProperty("last_time_editor_retried_uploading_media");
444+
break;
406445
case EDITOR_CLOSED:
407446
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
408447
mixpanelInstructionsForEventName("Editor - Closed");
@@ -502,6 +541,30 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
502541
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_underline");
503542
instructions.setCurrentDateForPeopleProperty("last_time_tapped_underline_in_editor");
504543
break;
544+
case EDITOR_TAPPED_HTML:
545+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
546+
mixpanelInstructionsForEventName("Editor - Tapped HTML Button");
547+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_html");
548+
instructions.setCurrentDateForPeopleProperty("last_time_tapped_html_in_editor");
549+
break;
550+
case EDITOR_TAPPED_ORDERED_LIST:
551+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
552+
mixpanelInstructionsForEventName("Editor - Tapped Ordered List Button");
553+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_ordered_list");
554+
instructions.setCurrentDateForPeopleProperty("last_time_tapped_ordered_list_in_editor");
555+
break;
556+
case EDITOR_TAPPED_UNLINK:
557+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
558+
mixpanelInstructionsForEventName("Editor - Tapped Unlink Button");
559+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_unlink");
560+
instructions.setCurrentDateForPeopleProperty("last_time_tapped_unlink_in_editor");
561+
break;
562+
case EDITOR_TAPPED_UNORDERED_LIST:
563+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
564+
mixpanelInstructionsForEventName("Editor - Tapped Unordered List Button");
565+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_unordered_list");
566+
instructions.setCurrentDateForPeopleProperty("last_time_tapped_unordered_list_in_editor");
567+
break;
505568
case NOTIFICATIONS_ACCESSED:
506569
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
507570
mixpanelInstructionsForEventName("Notifications - Accessed");

WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,27 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
120120
case EDITOR_SAVED_DRAFT:
121121
eventName = "editor_draft_saved";
122122
break;
123+
case EDITOR_DISCARDED_CHANGES:
124+
eventName = "editor_discarded_changes";
125+
break;
126+
case EDITOR_EDITED_IMAGE:
127+
eventName = "editor_image_edited";
128+
break;
129+
case EDITOR_ENABLED_NEW_VERSION:
130+
eventName = "editor_enabled_new_version";
131+
break;
132+
case EDITOR_TOGGLED_OFF:
133+
eventName = "editor_toggled_off";
134+
break;
135+
case EDITOR_TOGGLED_ON:
136+
eventName = "editor_toggled_on";
137+
break;
138+
case EDITOR_UPDLOAD_MEDIA_FAILED:
139+
eventName = "editor_upload_media_failed";
140+
break;
141+
case EDITOR_UPDLOAD_MEDIA_RETRIED:
142+
eventName = "editor_upload_media_retried";
143+
break;
123144
case EDITOR_CLOSED:
124145
eventName = "editor_closed";
125146
break;
@@ -180,6 +201,22 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
180201
eventName = "editor_button_tapped";
181202
predefinedEventProperties.put("button", "underline");
182203
break;
204+
case EDITOR_TAPPED_HTML:
205+
eventName = "editor_button_tapped";
206+
predefinedEventProperties.put("button", "html");
207+
break;
208+
case EDITOR_TAPPED_ORDERED_LIST:
209+
eventName = "editor_button_tapped";
210+
predefinedEventProperties.put("button", "ordered_list");
211+
break;
212+
case EDITOR_TAPPED_UNLINK:
213+
eventName = "editor_button_tapped";
214+
predefinedEventProperties.put("button", "unlink");
215+
break;
216+
case EDITOR_TAPPED_UNORDERED_LIST:
217+
eventName = "editor_button_tapped";
218+
predefinedEventProperties.put("button", "unordered_list");
219+
break;
183220
case NOTIFICATIONS_ACCESSED:
184221
eventName = "notifications_accessed";
185222
break;

0 commit comments

Comments
 (0)