Skip to content

Commit

Permalink
Add visual editor events to mixpanel and nosara trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Jan 5, 2016
1 parent baa34d5 commit 03ea4ab
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
Expand Up @@ -403,6 +403,45 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_saved_draft");
instructions.setCurrentDateForPeopleProperty("last_time_saved_draft");
break;
case EDITOR_DISCARDED_CHANGES:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Discarded Changes");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_discarded_changes");
instructions.setCurrentDateForPeopleProperty("last_time_discarded_changes");
break;
case EDITOR_EDITED_IMAGE:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Edited Image");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_edited_image");
instructions.setCurrentDateForPeopleProperty("last_time_edited_image");
break;
case EDITOR_ENABLED_NEW_VERSION:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Enabled New Version");
instructions.addSuperPropertyToFlag("enabled_new_editor");
break;
case EDITOR_TOGGLED_ON:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Toggled New Editor On");
instructions.setPeoplePropertyToValue("enabled_new_editor", true);
break;
case EDITOR_TOGGLED_OFF:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Toggled New Editor Off");
instructions.setPeoplePropertyToValue("enabled_new_editor", true);
break;
case EDITOR_UPDLOAD_MEDIA_FAILED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Upload Media Failed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_upload_media_failed");
instructions.setCurrentDateForPeopleProperty("last_time_editor_upload_media_failed");
break;
case EDITOR_UPDLOAD_MEDIA_RETRIED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Retried Uploading Media");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_retried_uploading_media");
instructions.setCurrentDateForPeopleProperty("last_time_editor_retried_uploading_media");
break;
case EDITOR_CLOSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Closed");
Expand Down Expand Up @@ -502,6 +541,30 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_underline");
instructions.setCurrentDateForPeopleProperty("last_time_tapped_underline_in_editor");
break;
case EDITOR_TAPPED_HTML:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Tapped HTML Button");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_html");
instructions.setCurrentDateForPeopleProperty("last_time_tapped_html_in_editor");
break;
case EDITOR_TAPPED_ORDERED_LIST:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Tapped Ordered List Button");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_ordered_list");
instructions.setCurrentDateForPeopleProperty("last_time_tapped_ordered_list_in_editor");
break;
case EDITOR_TAPPED_UNLINK:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Tapped Unlink Button");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_unlink");
instructions.setCurrentDateForPeopleProperty("last_time_tapped_unlink_in_editor");
break;
case EDITOR_TAPPED_UNORDERED_LIST:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Tapped Unordered List Button");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_editor_tapped_unordered_list");
instructions.setCurrentDateForPeopleProperty("last_time_tapped_unordered_list_in_editor");
break;
case NOTIFICATIONS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Notifications - Accessed");
Expand Down
Expand Up @@ -120,6 +120,27 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case EDITOR_SAVED_DRAFT:
eventName = "editor_draft_saved";
break;
case EDITOR_DISCARDED_CHANGES:
eventName = "editor_discarded_changes";
break;
case EDITOR_EDITED_IMAGE:
eventName = "editor_image_edited";
break;
case EDITOR_ENABLED_NEW_VERSION:
eventName = "editor_enabled_new_version";
break;
case EDITOR_TOGGLED_OFF:
eventName = "editor_toggled_off";
break;
case EDITOR_TOGGLED_ON:
eventName = "editor_toggled_on";
break;
case EDITOR_UPDLOAD_MEDIA_FAILED:
eventName = "editor_upload_media_failed";
break;
case EDITOR_UPDLOAD_MEDIA_RETRIED:
eventName = "editor_upload_media_retried";
break;
case EDITOR_CLOSED:
eventName = "editor_closed";
break;
Expand Down Expand Up @@ -180,6 +201,22 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
eventName = "editor_button_tapped";
predefinedEventProperties.put("button", "underline");
break;
case EDITOR_TAPPED_HTML:
eventName = "editor_button_tapped";
predefinedEventProperties.put("button", "html");
break;
case EDITOR_TAPPED_ORDERED_LIST:
eventName = "editor_button_tapped";
predefinedEventProperties.put("button", "ordered_list");
break;
case EDITOR_TAPPED_UNLINK:
eventName = "editor_button_tapped";
predefinedEventProperties.put("button", "unlink");
break;
case EDITOR_TAPPED_UNORDERED_LIST:
eventName = "editor_button_tapped";
predefinedEventProperties.put("button", "unordered_list");
break;
case NOTIFICATIONS_ACCESSED:
eventName = "notifications_accessed";
break;
Expand Down

0 comments on commit 03ea4ab

Please sign in to comment.