Skip to content

Commit

Permalink
Merge branch 'develop' into feature/update-to-gradle-2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Aug 25, 2015
2 parents f40c250 + f71193b commit 0709f0e
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WordPressAnalytics/build.gradle
Expand Up @@ -16,7 +16,7 @@ repositories {
}

dependencies {
compile 'com.automattic:tracks:1.0.3'
compile 'com.automattic:tracks:1.0.4'
compile 'com.mixpanel.android:mixpanel-android:4.3.0@aar'
compile 'org.wordpress:utils:1.3.0'
}
Expand Down
Expand Up @@ -19,6 +19,8 @@ public final class AnalyticsTracker {
public enum Stat {
APPLICATION_OPENED,
APPLICATION_CLOSED,
APPLICATION_STARTED,
APPLICATION_UPGRADED,
THEMES_ACCESSED_THEMES_BROWSER,
THEMES_CHANGED_THEME,
THEMES_PREVIEWED_SITE,
Expand All @@ -37,6 +39,11 @@ public enum Stat {
READER_BLOG_PREVIEW,
READER_TAG_PREVIEW,
STATS_ACCESSED,
STATS_INSIGHTS_ACCESSED,
STATS_PERIOD_DAYS_ACCESSED,
STATS_PERIOD_WEEKS_ACCESSED,
STATS_PERIOD_MONTHS_ACCESSED,
STATS_PERIOD_YEARS_ACCESSED,
STATS_VIEW_ALL_ACCESSED,
STATS_SINGLE_POST_ACCESSED,
STATS_OPENED_WEB_VERSION,
Expand All @@ -62,6 +69,8 @@ public enum Stat {
EDITOR_TAPPED_MORE,
EDITOR_TAPPED_STRIKETHROUGH,
EDITOR_TAPPED_UNDERLINE,
ME_ACCESSED,
MY_SITE_ACCESSED,
NOTIFICATIONS_ACCESSED,
NOTIFICATIONS_OPENED_NOTIFICATION_DETAILS,
NOTIFICATION_REPLIED_TO,
Expand All @@ -77,15 +86,15 @@ public enum Stat {
OPENED_VIEW_SITE,
OPENED_VIEW_ADMIN,
OPENED_MEDIA_LIBRARY,
OPENED_SETTINGS,
OPENED_BLOG_SETTINGS,
CREATED_ACCOUNT,
ACCOUNT_LOGOUT,
SHARED_ITEM,
ADDED_SELF_HOSTED_SITE,
SIGNED_IN,
SIGNED_INTO_JETPACK,
PERFORMED_JETPACK_SIGN_IN_FROM_STATS_SCREEN,
STATS_SELECTED_INSTALL_JETPACK,
APPLICATION_STARTED,
PUSH_NOTIFICATION_RECEIVED,
SUPPORT_OPENED_HELPSHIFT_SCREEN,
SUPPORT_SENT_REPLY_TO_SUPPORT_MESSAGE,
Expand All @@ -96,6 +105,10 @@ public enum Stat {
PUSH_AUTHENTICATION_FAILED,
PUSH_AUTHENTICATION_IGNORED,
SETTINGS_LANGUAGE_SELECTION_FORCED,
NOTIFICATION_SETTINGS_LIST_OPENED,
NOTIFICATION_SETTINGS_STREAMS_OPENED,
NOTIFICATION_SETTINGS_DETAILS_OPENED,
NOTIFICATION_SETTINGS_UPDATED,
}

public interface Tracker {
Expand Down
Expand Up @@ -17,7 +17,6 @@

import java.util.EnumMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;

public class AnalyticsTrackerMixpanel implements AnalyticsTracker.Tracker {
Expand Down Expand Up @@ -525,7 +524,7 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Site Menu - Opened Media Library");
break;
case OPENED_SETTINGS:
case OPENED_BLOG_SETTINGS:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Site Menu - Opened Settings");
break;
Expand Down Expand Up @@ -564,6 +563,36 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_stats");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_stats");
break;
case STATS_INSIGHTS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - Insights Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_insights_screen_stats");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_insights_screen_stats");
break;
case STATS_PERIOD_DAYS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - Period Days Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_days_screen_stats");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_days_screen_stats");
break;
case STATS_PERIOD_WEEKS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - Period Weeks Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_weeks_screen_stats");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_weeks_screen_stats");
break;
case STATS_PERIOD_MONTHS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - Period Months Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_months_screen_stats");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_months_screen_stats");
break;
case STATS_PERIOD_YEARS_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - Period Years Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_years_screen_stats");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_years_screen_stats");
break;
case STATS_VIEW_ALL_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - View All Accessed");
Expand Down Expand Up @@ -620,10 +649,52 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Login - Failed To Guess XMLRPC");
break;
case PUSH_AUTHENTICATION_APPROVED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Push Authentication - Approved");
break;
case PUSH_AUTHENTICATION_EXPIRED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Push Authentication - Expired");
break;
case PUSH_AUTHENTICATION_FAILED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Push Authentication - Failed");
break;
case PUSH_AUTHENTICATION_IGNORED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Push Authentication - Ignored");
break;
case SETTINGS_LANGUAGE_SELECTION_FORCED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Settings - Forced Language Selection");
break;
case NOTIFICATION_SETTINGS_LIST_OPENED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Notification Settings - Accessed List");
break;
case NOTIFICATION_SETTINGS_STREAMS_OPENED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Notification Settings - Accessed Stream");
break;
case NOTIFICATION_SETTINGS_DETAILS_OPENED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Notification Settings - Accessed Details");
break;
case NOTIFICATION_SETTINGS_UPDATED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Notification Settings - Updated");
break;
case ME_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Me Tab - Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_me_tab");
break;
case MY_SITE_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("My Site - Accessed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_my_site");
break;
default:
instructions = null;
break;
Expand Down
Expand Up @@ -61,6 +61,9 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case APPLICATION_CLOSED:
eventName = "application_closed";
break;
case APPLICATION_UPGRADED:
eventName = "application_upgraded";
break;
case THEMES_ACCESSED_THEMES_BROWSER:
eventName = "themes_theme_browser_accessed";
break;
Expand Down Expand Up @@ -237,7 +240,7 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
eventName = "site_menu_opened";
predefinedEventProperties.put("menu_item", "media_library");
break;
case OPENED_SETTINGS:
case OPENED_BLOG_SETTINGS:
eventName = "site_menu_opened";
predefinedEventProperties.put("menu_item", "settings");
break;
Expand All @@ -256,12 +259,34 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case SIGNED_INTO_JETPACK:
eventName = "signed_into_jetpack";
break;
case ACCOUNT_LOGOUT:
eventName = "account_logout";
break;
case PERFORMED_JETPACK_SIGN_IN_FROM_STATS_SCREEN:
eventName = "stats_screen_signed_into_jetpack";
break;
case STATS_ACCESSED:
eventName = "stats_accessed";
break;
case STATS_INSIGHTS_ACCESSED:
eventName = "stats_insights_accessed";
break;
case STATS_PERIOD_DAYS_ACCESSED:
eventName = "stats_period_accessed";
predefinedEventProperties.put("period", "days");
break;
case STATS_PERIOD_WEEKS_ACCESSED:
eventName = "stats_period_accessed";
predefinedEventProperties.put("period", "weeks");
break;
case STATS_PERIOD_MONTHS_ACCESSED:
eventName = "stats_period_accessed";
predefinedEventProperties.put("period", "months");
break;
case STATS_PERIOD_YEARS_ACCESSED:
eventName = "stats_period_accessed";
predefinedEventProperties.put("period", "years");
break;
case STATS_VIEW_ALL_ACCESSED:
eventName = "stats_view_all_accessed";
break;
Expand Down Expand Up @@ -295,6 +320,39 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case LOGIN_FAILED_TO_GUESS_XMLRPC:
eventName = "login_failed_to_guess_xmlrpc";
break;
case PUSH_AUTHENTICATION_APPROVED:
eventName = "push_authentication_approved";
break;
case PUSH_AUTHENTICATION_EXPIRED:
eventName = "push_authentication_expired";
break;
case PUSH_AUTHENTICATION_FAILED:
eventName = "push_authentication_failed";
break;
case PUSH_AUTHENTICATION_IGNORED:
eventName = "push_authentication_ignored";
break;
case SETTINGS_LANGUAGE_SELECTION_FORCED:
eventName = "settings_language_selection_forced";
break;
case NOTIFICATION_SETTINGS_LIST_OPENED:
eventName = "notification_settings_list_opened";
break;
case NOTIFICATION_SETTINGS_STREAMS_OPENED:
eventName = "notification_settings_streams_opened";
break;
case NOTIFICATION_SETTINGS_DETAILS_OPENED:
eventName = "notification_settings_details_opened";
break;
case NOTIFICATION_SETTINGS_UPDATED:
eventName = "notification_settings_updated";
break;
case ME_ACCESSED:
eventName = "me_tab_accessed";
break;
case MY_SITE_ACCESSED:
eventName = "my_site_tab_accessed";
break;
default:
eventName = null;
break;
Expand Down

0 comments on commit 0709f0e

Please sign in to comment.