Skip to content

Commit 12e5bb5

Browse files
committed
Refactoring cases to be consistent with previously existing tracking
1 parent e8ed675 commit 12e5bb5

File tree

3 files changed

+46
-70
lines changed

3 files changed

+46
-70
lines changed

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ public enum Stat {
2020
APPLICATION_OPENED,
2121
APPLICATION_CLOSED,
2222
APPLICATION_UPGRADED,
23-
THEMES_ACCESSED_THEMES_BROWSER,
24-
THEMES_CHANGED_THEME,
25-
THEMES_PREVIEWED_SITE,
2623
READER_ACCESSED,
2724
READER_ARTICLE_COMMENTED_ON,
2825
READER_ARTICLE_LIKED,
@@ -114,14 +111,14 @@ public enum Stat {
114111
NOTIFICATION_SETTINGS_STREAMS_OPENED,
115112
NOTIFICATION_SETTINGS_DETAILS_OPENED,
116113
NOTIFICATION_SETTINGS_UPDATED,
117-
THEME_BROWSER_ACCESSED,
118-
THEME_BROWSER_SEARCH_ACCESSED,
119-
THEME_ACTIVATED,
120-
THEME_DEMO_ACCESSED,
121-
THEME_PREVIEW_ACCESSED,
122-
THEME_CUSTOMIZE_ACCESSED,
123-
THEME_DETAILS_ACCESSED,
124-
THEME_SUPPORT_ACCESSED,
114+
THEMES_ACCESSED_THEMES_BROWSER,
115+
THEMES_ACCESSED_SEARCH,
116+
THEMES_CHANGED_THEME,
117+
THEMES_PREVIEWED_SITE,
118+
THEMES_DEMO_ACCESSED,
119+
THEMES_CUSTOMIZE_ACCESSED,
120+
THEMES_SUPPORT_ACCESSED,
121+
THEMES_DETAILS_ACCESSED,
125122
}
126123

127124
private static final List<Tracker> TRACKERS = new ArrayList<Tracker>();

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

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -270,24 +270,6 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
270270
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
271271
mixpanelInstructionsForEventName("Application Upgraded");
272272
break;
273-
case THEMES_ACCESSED_THEMES_BROWSER:
274-
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
275-
mixpanelInstructionsForEventName("Themes - Accessed Theme Browser");
276-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_theme_browser");
277-
instructions.setCurrentDateForPeopleProperty("last_time_accessed_theme_browser");
278-
break;
279-
case THEMES_CHANGED_THEME:
280-
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
281-
mixpanelInstructionsForEventName("Themes - Changed Theme");
282-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_changed_theme");
283-
instructions.setCurrentDateForPeopleProperty("last_time_changed_theme");
284-
break;
285-
case THEMES_PREVIEWED_SITE:
286-
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
287-
mixpanelInstructionsForEventName("Themes - Previewed Theme for Site");
288-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_previewed_a_theme");
289-
instructions.setCurrentDateForPeopleProperty("last_time_previewed_a_theme");
290-
break;
291273
case READER_ACCESSED:
292274
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
293275
mixpanelInstructionsForEventName("Reader - Accessed");
@@ -769,37 +751,43 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
769751
mixpanelInstructionsForEventName("My Site - Accessed");
770752
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_my_site");
771753
break;
772-
case THEME_BROWSER_ACCESSED:
754+
case THEMES_ACCESSED_THEMES_BROWSER:
773755
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
774-
mixpanelInstructionsForEventName("Theme Browser - Accessed");
756+
mixpanelInstructionsForEventName("Themes - Accessed Theme Browser");
757+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_theme_browser");
758+
instructions.setCurrentDateForPeopleProperty("last_time_accessed_theme_browser");
775759
break;
776-
case THEME_BROWSER_SEARCH_ACCESSED:
760+
case THEMES_ACCESSED_SEARCH:
777761
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
778-
mixpanelInstructionsForEventName("Theme Browser - Search Accessed");
762+
mixpanelInstructionsForEventName("Themes - Accessed Theme");
779763
break;
780-
case THEME_ACTIVATED:
764+
case THEMES_CHANGED_THEME:
781765
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
782-
mixpanelInstructionsForEventName("Theme Browser - Theme Activated");
766+
mixpanelInstructionsForEventName("Themes - Changed Theme");
767+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_changed_theme");
768+
instructions.setCurrentDateForPeopleProperty("last_time_changed_theme");
783769
break;
784-
case THEME_DEMO_ACCESSED:
770+
case THEMES_PREVIEWED_SITE:
785771
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
786-
mixpanelInstructionsForEventName("Theme Browser - Demo Accessed");
772+
mixpanelInstructionsForEventName("Themes - Previewed Theme for Site");
773+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_previewed_a_theme");
774+
instructions.setCurrentDateForPeopleProperty("last_time_previewed_a_theme");
787775
break;
788-
case THEME_PREVIEW_ACCESSED:
776+
case THEMES_DEMO_ACCESSED:
789777
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
790-
mixpanelInstructionsForEventName("Theme Browser - Preview Accessed");
778+
mixpanelInstructionsForEventName("Themes - Demo Accessed");
791779
break;
792-
case THEME_CUSTOMIZE_ACCESSED:
780+
case THEMES_CUSTOMIZE_ACCESSED:
793781
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
794-
mixpanelInstructionsForEventName("Theme Browser - Customize Accessed");
782+
mixpanelInstructionsForEventName("Themes - Customize Accessed");
795783
break;
796-
case THEME_DETAILS_ACCESSED:
784+
case THEMES_SUPPORT_ACCESSED:
797785
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
798-
mixpanelInstructionsForEventName("Theme Browser - Details Accessed");
786+
mixpanelInstructionsForEventName("Themes - Support Accessed");
799787
break;
800-
case THEME_SUPPORT_ACCESSED:
788+
case THEMES_DETAILS_ACCESSED:
801789
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
802-
mixpanelInstructionsForEventName("Theme Browser - Support Accessed");
790+
mixpanelInstructionsForEventName("Themes - Details Accessed");
803791
break;
804792
default:
805793
instructions = null;

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

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
5454
case APPLICATION_UPGRADED:
5555
eventName = "application_upgraded";
5656
break;
57-
case THEMES_ACCESSED_THEMES_BROWSER:
58-
eventName = "themes_theme_browser_accessed";
59-
break;
60-
case THEMES_CHANGED_THEME:
61-
eventName = "themes_theme_changed";
62-
break;
63-
case THEMES_PREVIEWED_SITE:
64-
eventName = "themes_theme_for_site_previewed";
65-
break;
6657
case READER_ACCESSED:
6758
eventName = "reader_accessed";
6859
break;
@@ -357,29 +348,29 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
357348
case MY_SITE_ACCESSED:
358349
eventName = "my_site_tab_accessed";
359350
break;
360-
case THEME_BROWSER_ACCESSED:
361-
eventName = "theme_browser_accessed";
351+
case THEMES_ACCESSED_THEMES_BROWSER:
352+
eventName = "themes_theme_browser_accessed";
362353
break;
363-
case THEME_BROWSER_SEARCH_ACCESSED:
364-
eventName = "theme_browser_search_accessed";
354+
case THEMES_ACCESSED_SEARCH:
355+
eventName = "themes_search_accessed";
365356
break;
366-
case THEME_ACTIVATED:
367-
eventName = "theme_activated";
357+
case THEMES_CHANGED_THEME:
358+
eventName = "themes_theme_changed";
368359
break;
369-
case THEME_DEMO_ACCESSED:
370-
eventName = "theme_demo_accessed";
360+
case THEMES_PREVIEWED_SITE:
361+
eventName = "themes_theme_for_site_previewed";
371362
break;
372-
case THEME_PREVIEW_ACCESSED:
373-
eventName = "theme_preview_accessed";
363+
case THEMES_DEMO_ACCESSED:
364+
eventName = "themes_demo_accessed";
374365
break;
375-
case THEME_CUSTOMIZE_ACCESSED:
376-
eventName = "theme_customize_accessed";
366+
case THEMES_CUSTOMIZE_ACCESSED:
367+
eventName = "themes_customize_accessed";
377368
break;
378-
case THEME_DETAILS_ACCESSED:
379-
eventName = "theme_details_accessed";
369+
case THEMES_SUPPORT_ACCESSED:
370+
eventName = "themes_support_accessed";
380371
break;
381-
case THEME_SUPPORT_ACCESSED:
382-
eventName = "theme_support_accessed";
372+
case THEMES_DETAILS_ACCESSED:
373+
eventName = "themes_details_accessed";
383374
break;
384375
default:
385376
eventName = null;

0 commit comments

Comments
 (0)