Skip to content

Commit

Permalink
Track analytics about the number of total sites followed
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloercoli committed Feb 20, 2024
1 parent 52a6334 commit 30d5acc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public String getTagName() {
}

public static class FollowedBlogsChanged {
private final int mTotalSubscriptions;
public int getTotalSubscriptions() {
return mTotalSubscriptions;
}
public FollowedBlogsChanged(int totalSubscriptions) {
mTotalSubscriptions = totalSubscriptions;
}
}

public static class InterestTagsFetchEnded {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,7 @@ && hasCurrentTag()
refreshPosts();
}

ReaderBlogTable.getFollowedBlogs();
ReaderTracker.trackFollowedTagsCount(ReaderTagTable.getFollowedTags().size());
AppPrefs.setReaderAnalyticsCountTagsTimestamp(now);
ReaderTracker.trackFollowedSitesCount(event.getTotalSubscriptions());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,10 @@ public void run() {
// changed if the server list doesn't have the same blogs as the local list
// (ie: a blog has been followed/unfollowed since local was last updated)
if (!localBlogs.hasSameBlogs(serverBlogs)) {
final int totalSites = jsonObject == null ? 0 : jsonObject.optInt("total_subscriptions", 0);
ReaderPostTable.updateFollowedStatus();
AppLog.i(AppLog.T.READER, "reader blogs service > followed blogs changed");
EventBus.getDefault().post(new ReaderEvents.FollowedBlogsChanged());
EventBus.getDefault().post(new ReaderEvents.FollowedBlogsChanged(totalSites));
}
}

Expand Down

0 comments on commit 30d5acc

Please sign in to comment.