Skip to content

Commit

Permalink
Track new events for Insights & Period Stats in Tracks and Mixpanel.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloercoli committed Jun 24, 2015
1 parent 71a3931 commit b9678b5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,31 @@ 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");
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");
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");
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");
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");
case STATS_VIEW_ALL_ACCESSED:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Stats - View All Accessed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,25 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
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

0 comments on commit b9678b5

Please sign in to comment.