Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ss-Android into feature/2968-stats-widget-new
  • Loading branch information
daniloercoli committed Oct 6, 2015
2 parents 912796d + f0ce2b8 commit f4a7395
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 72 deletions.
Expand Up @@ -24,19 +24,26 @@ public enum Stat {
THEMES_CHANGED_THEME,
THEMES_PREVIEWED_SITE,
READER_ACCESSED,
READER_OPENED_ARTICLE,
READER_LIKED_ARTICLE,
READER_REBLOGGED_ARTICLE,
READER_ARTICLE_COMMENTED_ON,
READER_ARTICLE_LIKED,
READER_ARTICLE_OPENED,
READER_ARTICLE_REBLOGGED,
READER_ARTICLE_UNLIKED,
READER_BLOG_BLOCKED,
READER_BLOG_FOLLOWED,
READER_BLOG_PREVIEWED,
READER_BLOG_UNFOLLOWED,
READER_DISCOVER_VIEWED,
READER_FRESHLY_PRESSED_LOADED,
READER_INFINITE_SCROLL,
READER_FOLLOWED_READER_TAG,
READER_UNFOLLOWED_READER_TAG,
READER_FOLLOWED_SITE,
READER_LOADED_TAG,
READER_LOADED_FRESHLY_PRESSED,
READER_COMMENTED_ON_ARTICLE,
READER_BLOCKED_BLOG,
READER_BLOG_PREVIEW,
READER_TAG_PREVIEW,
READER_LIST_FOLLOWED,
READER_LIST_LOADED,
READER_LIST_PREVIEWED,
READER_LIST_UNFOLLOWED,
READER_TAG_FOLLOWED,
READER_TAG_LOADED,
READER_TAG_PREVIEWED,
READER_TAG_UNFOLLOWED,
STATS_ACCESSED,
STATS_INSIGHTS_ACCESSED,
STATS_PERIOD_DAYS_ACCESSED,
Expand Down
Expand Up @@ -294,83 +294,129 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_reader");
instructions.setCurrentDateForPeopleProperty("last_time_accessed_reader");
break;
case READER_OPENED_ARTICLE:
case READER_ARTICLE_COMMENTED_ON:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Opened Article");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_opened_article");
instructions.setCurrentDateForPeopleProperty("last_time_opened_reader_article");
mixpanelInstructionsForEventName("Reader - Commented on Article");
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
"number_of_times_commented_on_reader_article");
instructions.setCurrentDateForPeopleProperty("last_time_commented_on_article");
break;
case READER_LIKED_ARTICLE:
case READER_ARTICLE_LIKED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Liked Article");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_liked_article");
instructions.setCurrentDateForPeopleProperty("last_time_liked_reader_article");
break;
case READER_REBLOGGED_ARTICLE:
case READER_ARTICLE_OPENED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Opened Article");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_opened_article");
instructions.setCurrentDateForPeopleProperty("last_time_opened_reader_article");
break;
case READER_ARTICLE_REBLOGGED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Reblogged Article");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_reblogged_article");
instructions.setCurrentDateForPeopleProperty("last_time_reblogged_article");
break;
case READER_INFINITE_SCROLL:
case READER_ARTICLE_UNLIKED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Infinite Scroll");
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
"number_of_times_reader_performed_infinite_scroll");
instructions.setCurrentDateForPeopleProperty("last_time_performed_reader_infinite_scroll");
mixpanelInstructionsForEventName("Reader - Unliked Article");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unliked_article");
instructions.setCurrentDateForPeopleProperty("last_time_unliked_reader_article");
break;
case READER_FOLLOWED_READER_TAG:
case READER_BLOG_BLOCKED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Followed Reader Tag");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_reader_tag");
instructions.setCurrentDateForPeopleProperty("last_time_followed_reader_tag");
mixpanelInstructionsForEventName("Reader - Blocked Blog");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_blocked_a_blog");
instructions.setCurrentDateForPeopleProperty("last_time_blocked_a_blog");
break;
case READER_UNFOLLOWED_READER_TAG:
case READER_BLOG_FOLLOWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Unfollowed Reader Tag");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_reader_tag");
mixpanelInstructionsForEventName("Reader - Followed Site");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_site");
instructions.setCurrentDateForPeopleProperty("last_time_followed_site");
break;
case READER_LOADED_TAG:
case READER_BLOG_PREVIEWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Loaded Tag");
mixpanelInstructionsForEventName("Reader - Blog Preview");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_blog_preview");
instructions.setCurrentDateForPeopleProperty("last_time_viewed_blog_preview");
break;
case READER_BLOG_UNFOLLOWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Unfollowed Site");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_site");
instructions.setCurrentDateForPeopleProperty("last_time_unfollowed_site");
break;
case READER_LOADED_FRESHLY_PRESSED:
case READER_DISCOVER_VIEWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Discover Content Viewed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
"number_of_times_discover_content_viewed");
instructions.setCurrentDateForPeopleProperty("last_time_discover_content_viewed");
break;
case READER_FRESHLY_PRESSED_LOADED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Loaded Freshly Pressed");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_loaded_freshly_pressed");
instructions.setCurrentDateForPeopleProperty("last_time_loaded_freshly_pressed");
break;
case READER_COMMENTED_ON_ARTICLE:
case READER_INFINITE_SCROLL:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Commented on Article");
mixpanelInstructionsForEventName("Reader - Infinite Scroll");
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
"number_of_times_commented_on_reader_article");
instructions.setCurrentDateForPeopleProperty("last_time_commented_on_article");
"number_of_times_reader_performed_infinite_scroll");
instructions.setCurrentDateForPeopleProperty("last_time_performed_reader_infinite_scroll");
break;
case READER_FOLLOWED_SITE:
case READER_LIST_FOLLOWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Followed Site");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_site");
instructions.setCurrentDateForPeopleProperty("last_time_followed_site");
mixpanelInstructionsForEventName("Reader - Followed List");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_list");
instructions.setCurrentDateForPeopleProperty("last_time_followed_list");
break;
case READER_BLOCKED_BLOG:
case READER_LIST_LOADED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Blocked Blog");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_blocked_a_blog");
instructions.setCurrentDateForPeopleProperty("last_time_blocked_a_blog");
mixpanelInstructionsForEventName("Reader - Loaded List");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_loaded_list");
instructions.setCurrentDateForPeopleProperty("last_time_loaded_list");
break;
case READER_BLOG_PREVIEW:
case READER_LIST_PREVIEWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Blog Preview");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_blog_preview");
instructions.setCurrentDateForPeopleProperty("last_time_viewed_blog_preview");
mixpanelInstructionsForEventName("Reader - List Preview");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_list_preview");
instructions.setCurrentDateForPeopleProperty("last_time_viewed_list_preview");
break;
case READER_LIST_UNFOLLOWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Unfollowed List");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_list");
instructions.setCurrentDateForPeopleProperty("last_time_unfollowed_list");
break;
case READER_TAG_FOLLOWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Followed Reader Tag");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_reader_tag");
instructions.setCurrentDateForPeopleProperty("last_time_followed_reader_tag");
break;
case READER_TAG_LOADED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Loaded Tag");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_loaded_tag");
instructions.setCurrentDateForPeopleProperty("last_time_loaded_tag");
break;
case READER_TAG_PREVIEW:
case READER_TAG_PREVIEWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Tag Preview");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_tag_preview");
instructions.setCurrentDateForPeopleProperty("last_time_viewed_tag_preview");
break;
case READER_TAG_UNFOLLOWED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Reader - Unfollowed Reader Tag");
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_reader_tag");
instructions.setCurrentDateForPeopleProperty("last_time_unfollowed_reader_tag");
break;
case EDITOR_CREATED_POST:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Editor - Created Post");
Expand Down
Expand Up @@ -66,45 +66,66 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case READER_ACCESSED:
eventName = "reader_accessed";
break;
case READER_OPENED_ARTICLE:
eventName = "reader_article_opened";
case READER_ARTICLE_COMMENTED_ON:
eventName = "reader_article_commented_on";
break;
case READER_LIKED_ARTICLE:
case READER_ARTICLE_LIKED:
eventName = "reader_article_liked";
break;
case READER_REBLOGGED_ARTICLE:
case READER_ARTICLE_OPENED:
eventName = "reader_article_opened";
break;
case READER_ARTICLE_REBLOGGED:
eventName = "reader_article_reblogged";
break;
case READER_INFINITE_SCROLL:
eventName = "reader_infinite_scroll_performed";
case READER_ARTICLE_UNLIKED:
eventName = "reader_article_unliked";
break;
case READER_FOLLOWED_READER_TAG:
eventName = "reader_reader_tag_followed";
case READER_BLOG_BLOCKED:
eventName = "reader_blog_blocked";
break;
case READER_UNFOLLOWED_READER_TAG:
eventName = "reader_reader_tag_unfollowed";
case READER_BLOG_FOLLOWED:
eventName = "reader_site_followed";
break;
case READER_LOADED_TAG:
eventName = "reader_tag_loaded";
case READER_BLOG_PREVIEWED:
eventName = "reader_blog_previewed";
break;
case READER_BLOG_UNFOLLOWED:
eventName = "reader_site_unfollowed";
break;
case READER_DISCOVER_VIEWED:
eventName = "reader_discover_viewed";
break;
case READER_LOADED_FRESHLY_PRESSED:
case READER_FRESHLY_PRESSED_LOADED:
eventName = "reader_freshly_pressed_loaded";
break;
case READER_COMMENTED_ON_ARTICLE:
eventName = "reader_article_commented_on";
case READER_INFINITE_SCROLL:
eventName = "reader_infinite_scroll_performed";
break;
case READER_FOLLOWED_SITE:
eventName = "reader_site_followed";
case READER_LIST_FOLLOWED:
eventName = "reader_list_followed";
break;
case READER_BLOCKED_BLOG:
eventName = "reader_blog_blocked";
case READER_LIST_LOADED:
eventName = "reader_list_loaded";
break;
case READER_BLOG_PREVIEW:
eventName = "reader_blog_previewed";
case READER_LIST_PREVIEWED:
eventName = "reader_list_previewed";
break;
case READER_LIST_UNFOLLOWED:
eventName = "reader_list_unfollowed";
break;
case READER_TAG_PREVIEW:
case READER_TAG_FOLLOWED:
eventName = "reader_reader_tag_followed";
break;
case READER_TAG_LOADED:
eventName = "reader_tag_loaded";
break;
case READER_TAG_PREVIEWED:
eventName = "reader_tag_previewed";
break;
case READER_TAG_UNFOLLOWED:
eventName = "reader_reader_tag_unfollowed";
break;
case EDITOR_CREATED_POST:
eventName = "editor_post_created";
break;
Expand Down

0 comments on commit f4a7395

Please sign in to comment.