Skip to content

Commit f0ce2b8

Browse files
committed
Reader: Organizes and adds new analytics for the reader.
Renames some existing enums to match the tracks naming convention Alphabetizes the lists Adds new analytic for lists, discover, and unliking. Some of these anticipate future feature support.
1 parent 10e7328 commit f0ce2b8

File tree

3 files changed

+146
-72
lines changed

3 files changed

+146
-72
lines changed

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

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,26 @@ public enum Stat {
2424
THEMES_CHANGED_THEME,
2525
THEMES_PREVIEWED_SITE,
2626
READER_ACCESSED,
27-
READER_OPENED_ARTICLE,
28-
READER_LIKED_ARTICLE,
29-
READER_REBLOGGED_ARTICLE,
27+
READER_ARTICLE_COMMENTED_ON,
28+
READER_ARTICLE_LIKED,
29+
READER_ARTICLE_OPENED,
30+
READER_ARTICLE_REBLOGGED,
31+
READER_ARTICLE_UNLIKED,
32+
READER_BLOG_BLOCKED,
33+
READER_BLOG_FOLLOWED,
34+
READER_BLOG_PREVIEWED,
35+
READER_BLOG_UNFOLLOWED,
36+
READER_DISCOVER_VIEWED,
37+
READER_FRESHLY_PRESSED_LOADED,
3038
READER_INFINITE_SCROLL,
31-
READER_FOLLOWED_READER_TAG,
32-
READER_UNFOLLOWED_READER_TAG,
33-
READER_FOLLOWED_SITE,
34-
READER_LOADED_TAG,
35-
READER_LOADED_FRESHLY_PRESSED,
36-
READER_COMMENTED_ON_ARTICLE,
37-
READER_BLOCKED_BLOG,
38-
READER_BLOG_PREVIEW,
39-
READER_TAG_PREVIEW,
39+
READER_LIST_FOLLOWED,
40+
READER_LIST_LOADED,
41+
READER_LIST_PREVIEWED,
42+
READER_LIST_UNFOLLOWED,
43+
READER_TAG_FOLLOWED,
44+
READER_TAG_LOADED,
45+
READER_TAG_PREVIEWED,
46+
READER_TAG_UNFOLLOWED,
4047
STATS_ACCESSED,
4148
STATS_INSIGHTS_ACCESSED,
4249
STATS_PERIOD_DAYS_ACCESSED,

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

Lines changed: 84 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -289,83 +289,129 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
289289
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_accessed_reader");
290290
instructions.setCurrentDateForPeopleProperty("last_time_accessed_reader");
291291
break;
292-
case READER_OPENED_ARTICLE:
292+
case READER_ARTICLE_COMMENTED_ON:
293293
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
294-
mixpanelInstructionsForEventName("Reader - Opened Article");
295-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_opened_article");
296-
instructions.setCurrentDateForPeopleProperty("last_time_opened_reader_article");
294+
mixpanelInstructionsForEventName("Reader - Commented on Article");
295+
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
296+
"number_of_times_commented_on_reader_article");
297+
instructions.setCurrentDateForPeopleProperty("last_time_commented_on_article");
297298
break;
298-
case READER_LIKED_ARTICLE:
299+
case READER_ARTICLE_LIKED:
299300
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
300301
mixpanelInstructionsForEventName("Reader - Liked Article");
301302
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_liked_article");
302303
instructions.setCurrentDateForPeopleProperty("last_time_liked_reader_article");
303304
break;
304-
case READER_REBLOGGED_ARTICLE:
305+
case READER_ARTICLE_OPENED:
306+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
307+
mixpanelInstructionsForEventName("Reader - Opened Article");
308+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_opened_article");
309+
instructions.setCurrentDateForPeopleProperty("last_time_opened_reader_article");
310+
break;
311+
case READER_ARTICLE_REBLOGGED:
305312
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
306313
mixpanelInstructionsForEventName("Reader - Reblogged Article");
307314
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_reblogged_article");
308315
instructions.setCurrentDateForPeopleProperty("last_time_reblogged_article");
309316
break;
310-
case READER_INFINITE_SCROLL:
317+
case READER_ARTICLE_UNLIKED:
311318
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
312-
mixpanelInstructionsForEventName("Reader - Infinite Scroll");
313-
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
314-
"number_of_times_reader_performed_infinite_scroll");
315-
instructions.setCurrentDateForPeopleProperty("last_time_performed_reader_infinite_scroll");
319+
mixpanelInstructionsForEventName("Reader - Unliked Article");
320+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unliked_article");
321+
instructions.setCurrentDateForPeopleProperty("last_time_unliked_reader_article");
316322
break;
317-
case READER_FOLLOWED_READER_TAG:
323+
case READER_BLOG_BLOCKED:
318324
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
319-
mixpanelInstructionsForEventName("Reader - Followed Reader Tag");
320-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_reader_tag");
321-
instructions.setCurrentDateForPeopleProperty("last_time_followed_reader_tag");
325+
mixpanelInstructionsForEventName("Reader - Blocked Blog");
326+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_blocked_a_blog");
327+
instructions.setCurrentDateForPeopleProperty("last_time_blocked_a_blog");
322328
break;
323-
case READER_UNFOLLOWED_READER_TAG:
329+
case READER_BLOG_FOLLOWED:
324330
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
325-
mixpanelInstructionsForEventName("Reader - Unfollowed Reader Tag");
326-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_reader_tag");
331+
mixpanelInstructionsForEventName("Reader - Followed Site");
332+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_site");
333+
instructions.setCurrentDateForPeopleProperty("last_time_followed_site");
327334
break;
328-
case READER_LOADED_TAG:
335+
case READER_BLOG_PREVIEWED:
329336
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
330-
mixpanelInstructionsForEventName("Reader - Loaded Tag");
337+
mixpanelInstructionsForEventName("Reader - Blog Preview");
338+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_blog_preview");
339+
instructions.setCurrentDateForPeopleProperty("last_time_viewed_blog_preview");
340+
break;
341+
case READER_BLOG_UNFOLLOWED:
342+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
343+
mixpanelInstructionsForEventName("Reader - Unfollowed Site");
344+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_site");
345+
instructions.setCurrentDateForPeopleProperty("last_time_unfollowed_site");
331346
break;
332-
case READER_LOADED_FRESHLY_PRESSED:
347+
case READER_DISCOVER_VIEWED:
348+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
349+
mixpanelInstructionsForEventName("Reader - Discover Content Viewed");
350+
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
351+
"number_of_times_discover_content_viewed");
352+
instructions.setCurrentDateForPeopleProperty("last_time_discover_content_viewed");
353+
break;
354+
case READER_FRESHLY_PRESSED_LOADED:
333355
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
334356
mixpanelInstructionsForEventName("Reader - Loaded Freshly Pressed");
335357
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_loaded_freshly_pressed");
336358
instructions.setCurrentDateForPeopleProperty("last_time_loaded_freshly_pressed");
337359
break;
338-
case READER_COMMENTED_ON_ARTICLE:
360+
case READER_INFINITE_SCROLL:
339361
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
340-
mixpanelInstructionsForEventName("Reader - Commented on Article");
362+
mixpanelInstructionsForEventName("Reader - Infinite Scroll");
341363
instructions.setSuperPropertyAndPeoplePropertyToIncrement(
342-
"number_of_times_commented_on_reader_article");
343-
instructions.setCurrentDateForPeopleProperty("last_time_commented_on_article");
364+
"number_of_times_reader_performed_infinite_scroll");
365+
instructions.setCurrentDateForPeopleProperty("last_time_performed_reader_infinite_scroll");
344366
break;
345-
case READER_FOLLOWED_SITE:
367+
case READER_LIST_FOLLOWED:
346368
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
347-
mixpanelInstructionsForEventName("Reader - Followed Site");
348-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_site");
349-
instructions.setCurrentDateForPeopleProperty("last_time_followed_site");
369+
mixpanelInstructionsForEventName("Reader - Followed List");
370+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_list");
371+
instructions.setCurrentDateForPeopleProperty("last_time_followed_list");
350372
break;
351-
case READER_BLOCKED_BLOG:
373+
case READER_LIST_LOADED:
352374
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
353-
mixpanelInstructionsForEventName("Reader - Blocked Blog");
354-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_blocked_a_blog");
355-
instructions.setCurrentDateForPeopleProperty("last_time_blocked_a_blog");
375+
mixpanelInstructionsForEventName("Reader - Loaded List");
376+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_loaded_list");
377+
instructions.setCurrentDateForPeopleProperty("last_time_loaded_list");
356378
break;
357-
case READER_BLOG_PREVIEW:
379+
case READER_LIST_PREVIEWED:
358380
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
359-
mixpanelInstructionsForEventName("Reader - Blog Preview");
360-
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_blog_preview");
361-
instructions.setCurrentDateForPeopleProperty("last_time_viewed_blog_preview");
381+
mixpanelInstructionsForEventName("Reader - List Preview");
382+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_list_preview");
383+
instructions.setCurrentDateForPeopleProperty("last_time_viewed_list_preview");
384+
break;
385+
case READER_LIST_UNFOLLOWED:
386+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
387+
mixpanelInstructionsForEventName("Reader - Unfollowed List");
388+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_list");
389+
instructions.setCurrentDateForPeopleProperty("last_time_unfollowed_list");
390+
break;
391+
case READER_TAG_FOLLOWED:
392+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
393+
mixpanelInstructionsForEventName("Reader - Followed Reader Tag");
394+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_followed_reader_tag");
395+
instructions.setCurrentDateForPeopleProperty("last_time_followed_reader_tag");
396+
break;
397+
case READER_TAG_LOADED:
398+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
399+
mixpanelInstructionsForEventName("Reader - Loaded Tag");
400+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_loaded_tag");
401+
instructions.setCurrentDateForPeopleProperty("last_time_loaded_tag");
362402
break;
363-
case READER_TAG_PREVIEW:
403+
case READER_TAG_PREVIEWED:
364404
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
365405
mixpanelInstructionsForEventName("Reader - Tag Preview");
366406
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_viewed_tag_preview");
367407
instructions.setCurrentDateForPeopleProperty("last_time_viewed_tag_preview");
368408
break;
409+
case READER_TAG_UNFOLLOWED:
410+
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
411+
mixpanelInstructionsForEventName("Reader - Unfollowed Reader Tag");
412+
instructions.setSuperPropertyAndPeoplePropertyToIncrement("number_of_times_unfollowed_reader_tag");
413+
instructions.setCurrentDateForPeopleProperty("last_time_unfollowed_reader_tag");
414+
break;
369415
case EDITOR_CREATED_POST:
370416
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
371417
mixpanelInstructionsForEventName("Editor - Created Post");

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

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,45 +66,66 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
6666
case READER_ACCESSED:
6767
eventName = "reader_accessed";
6868
break;
69-
case READER_OPENED_ARTICLE:
70-
eventName = "reader_article_opened";
69+
case READER_ARTICLE_COMMENTED_ON:
70+
eventName = "reader_article_commented_on";
7171
break;
72-
case READER_LIKED_ARTICLE:
72+
case READER_ARTICLE_LIKED:
7373
eventName = "reader_article_liked";
7474
break;
75-
case READER_REBLOGGED_ARTICLE:
75+
case READER_ARTICLE_OPENED:
76+
eventName = "reader_article_opened";
77+
break;
78+
case READER_ARTICLE_REBLOGGED:
7679
eventName = "reader_article_reblogged";
7780
break;
78-
case READER_INFINITE_SCROLL:
79-
eventName = "reader_infinite_scroll_performed";
81+
case READER_ARTICLE_UNLIKED:
82+
eventName = "reader_article_unliked";
8083
break;
81-
case READER_FOLLOWED_READER_TAG:
82-
eventName = "reader_reader_tag_followed";
84+
case READER_BLOG_BLOCKED:
85+
eventName = "reader_blog_blocked";
8386
break;
84-
case READER_UNFOLLOWED_READER_TAG:
85-
eventName = "reader_reader_tag_unfollowed";
87+
case READER_BLOG_FOLLOWED:
88+
eventName = "reader_site_followed";
8689
break;
87-
case READER_LOADED_TAG:
88-
eventName = "reader_tag_loaded";
90+
case READER_BLOG_PREVIEWED:
91+
eventName = "reader_blog_previewed";
92+
break;
93+
case READER_BLOG_UNFOLLOWED:
94+
eventName = "reader_site_unfollowed";
95+
break;
96+
case READER_DISCOVER_VIEWED:
97+
eventName = "reader_discover_viewed";
8998
break;
90-
case READER_LOADED_FRESHLY_PRESSED:
99+
case READER_FRESHLY_PRESSED_LOADED:
91100
eventName = "reader_freshly_pressed_loaded";
92101
break;
93-
case READER_COMMENTED_ON_ARTICLE:
94-
eventName = "reader_article_commented_on";
102+
case READER_INFINITE_SCROLL:
103+
eventName = "reader_infinite_scroll_performed";
95104
break;
96-
case READER_FOLLOWED_SITE:
97-
eventName = "reader_site_followed";
105+
case READER_LIST_FOLLOWED:
106+
eventName = "reader_list_followed";
98107
break;
99-
case READER_BLOCKED_BLOG:
100-
eventName = "reader_blog_blocked";
108+
case READER_LIST_LOADED:
109+
eventName = "reader_list_loaded";
101110
break;
102-
case READER_BLOG_PREVIEW:
103-
eventName = "reader_blog_previewed";
111+
case READER_LIST_PREVIEWED:
112+
eventName = "reader_list_previewed";
113+
break;
114+
case READER_LIST_UNFOLLOWED:
115+
eventName = "reader_list_unfollowed";
104116
break;
105-
case READER_TAG_PREVIEW:
117+
case READER_TAG_FOLLOWED:
118+
eventName = "reader_reader_tag_followed";
119+
break;
120+
case READER_TAG_LOADED:
121+
eventName = "reader_tag_loaded";
122+
break;
123+
case READER_TAG_PREVIEWED:
106124
eventName = "reader_tag_previewed";
107125
break;
126+
case READER_TAG_UNFOLLOWED:
127+
eventName = "reader_reader_tag_unfollowed";
128+
break;
108129
case EDITOR_CREATED_POST:
109130
eventName = "editor_post_created";
110131
break;

0 commit comments

Comments
 (0)