Skip to content

Commit

Permalink
Refactoring cases to be consistent with previously existing tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonye committed Nov 13, 2015
1 parent e8ed675 commit 12e5bb5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public enum Stat {
APPLICATION_OPENED,
APPLICATION_CLOSED,
APPLICATION_UPGRADED,
THEMES_ACCESSED_THEMES_BROWSER,
THEMES_CHANGED_THEME,
THEMES_PREVIEWED_SITE,
READER_ACCESSED,
READER_ARTICLE_COMMENTED_ON,
READER_ARTICLE_LIKED,
Expand Down Expand Up @@ -114,14 +111,14 @@ public enum Stat {
NOTIFICATION_SETTINGS_STREAMS_OPENED,
NOTIFICATION_SETTINGS_DETAILS_OPENED,
NOTIFICATION_SETTINGS_UPDATED,
THEME_BROWSER_ACCESSED,
THEME_BROWSER_SEARCH_ACCESSED,
THEME_ACTIVATED,
THEME_DEMO_ACCESSED,
THEME_PREVIEW_ACCESSED,
THEME_CUSTOMIZE_ACCESSED,
THEME_DETAILS_ACCESSED,
THEME_SUPPORT_ACCESSED,
THEMES_ACCESSED_THEMES_BROWSER,
THEMES_ACCESSED_SEARCH,
THEMES_CHANGED_THEME,
THEMES_PREVIEWED_SITE,
THEMES_DEMO_ACCESSED,
THEMES_CUSTOMIZE_ACCESSED,
THEMES_SUPPORT_ACCESSED,
THEMES_DETAILS_ACCESSED,
}

private static final List<Tracker> TRACKERS = new ArrayList<Tracker>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,24 +270,6 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Application Upgraded");
break;
case THEMES_ACCESSED_THEMES_BROWSER:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Themes - Accessed Theme Browser");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_theme_browser");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_theme_browser");
break;
case THEMES_CHANGED_THEME:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Themes - Changed Theme");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_changed_theme");
instructions.setCurrentDateForPeopleProperty("last_time_changed_theme");
break;
case THEMES_PREVIEWED_SITE:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Themes - Previewed Theme for Site");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_previewed_a_theme");
instructions.setCurrentDateForPeopleProperty("last_time_previewed_a_theme");
break;
case READER_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Accessed");
Expand Down Expand Up @@ -769,37 +751,43 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
mixpanelInstructionsForEventName("My Site - Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_my_site");
break;
case THEME_BROWSER_ACCESSED:
case THEMES_ACCESSED_THEMES_BROWSER:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Accessed");
mixpanelInstructionsForEventName("Themes - Accessed Theme Browser");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_theme_browser");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_theme_browser");
break;
case THEME_BROWSER_SEARCH_ACCESSED:
case THEMES_ACCESSED_SEARCH:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Search Accessed");
mixpanelInstructionsForEventName("Themes - Accessed Theme");
break;
case THEME_ACTIVATED:
case THEMES_CHANGED_THEME:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Theme Activated");
mixpanelInstructionsForEventName("Themes - Changed Theme");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_changed_theme");
instructions.setCurrentDateForPeopleProperty("last_time_changed_theme");
break;
case THEME_DEMO_ACCESSED:
case THEMES_PREVIEWED_SITE:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Demo Accessed");
mixpanelInstructionsForEventName("Themes - Previewed Theme for Site");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_previewed_a_theme");
instructions.setCurrentDateForPeopleProperty("last_time_previewed_a_theme");
break;
case THEME_PREVIEW_ACCESSED:
case THEMES_DEMO_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Preview Accessed");
mixpanelInstructionsForEventName("Themes - Demo Accessed");
break;
case THEME_CUSTOMIZE_ACCESSED:
case THEMES_CUSTOMIZE_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Customize Accessed");
mixpanelInstructionsForEventName("Themes - Customize Accessed");
break;
case THEME_DETAILS_ACCESSED:
case THEMES_SUPPORT_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Details Accessed");
mixpanelInstructionsForEventName("Themes - Support Accessed");
break;
case THEME_SUPPORT_ACCESSED:
case THEMES_DETAILS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Theme Browser - Support Accessed");
mixpanelInstructionsForEventName("Themes - Details Accessed");
break;
default:
instructions = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case APPLICATION_UPGRADED:
eventName = "application_upgraded";
break;
case THEMES_ACCESSED_THEMES_BROWSER:
eventName = "themes_theme_browser_accessed";
break;
case THEMES_CHANGED_THEME:
eventName = "themes_theme_changed";
break;
case THEMES_PREVIEWED_SITE:
eventName = "themes_theme_for_site_previewed";
break;
case READER_ACCESSED:
eventName = "reader_accessed";
break;
Expand Down Expand Up @@ -357,29 +348,29 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case MY_SITE_ACCESSED:
eventName = "my_site_tab_accessed";
break;
case THEME_BROWSER_ACCESSED:
eventName = "theme_browser_accessed";
case THEMES_ACCESSED_THEMES_BROWSER:
eventName = "themes_theme_browser_accessed";
break;
case THEME_BROWSER_SEARCH_ACCESSED:
eventName = "theme_browser_search_accessed";
case THEMES_ACCESSED_SEARCH:
eventName = "themes_search_accessed";
break;
case THEME_ACTIVATED:
eventName = "theme_activated";
case THEMES_CHANGED_THEME:
eventName = "themes_theme_changed";
break;
case THEME_DEMO_ACCESSED:
eventName = "theme_demo_accessed";
case THEMES_PREVIEWED_SITE:
eventName = "themes_theme_for_site_previewed";
break;
case THEME_PREVIEW_ACCESSED:
eventName = "theme_preview_accessed";
case THEMES_DEMO_ACCESSED:
eventName = "themes_demo_accessed";
break;
case THEME_CUSTOMIZE_ACCESSED:
eventName = "theme_customize_accessed";
case THEMES_CUSTOMIZE_ACCESSED:
eventName = "themes_customize_accessed";
break;
case THEME_DETAILS_ACCESSED:
eventName = "theme_details_accessed";
case THEMES_SUPPORT_ACCESSED:
eventName = "themes_support_accessed";
break;
case THEME_SUPPORT_ACCESSED:
eventName = "theme_support_accessed";
case THEMES_DETAILS_ACCESSED:
eventName = "themes_details_accessed";
break;
default:
eventName = null;
Expand Down

0 comments on commit 12e5bb5

Please sign in to comment.