Source:
public static void trackSavePostAnalytics(PostModel post, SiteModel site) { PostStatus status = PostStatus.fromPost(post); Map<String, Object> properties = new HashMap<>(); switch (status) { case PUBLISHED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { } break; case SCHEDULED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { properties.put("word_count", AnalyticsUtils.getWordCount(post.getContent())); properties.put("editor_source", AppPrefs.isGutenbergEditorEnabled() ? "gutenberg" : (AppPrefs.isAztecEditorEnabled() ? "aztec" : AppPrefs.isVisualEditorEnabled() ? "hybrid" : "legacy")); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SCHEDULED_POST, site, properties); } break; case DRAFT: properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SAVED_DRAFT, site, properties); break; default: } }

Target:
public static void trackSavePostAnalytics(PostModel post, SiteModel site) { PostStatus status = PostStatus.fromPost(post); Map<String, Object> properties = new HashMap<>(); switch (status) { case PUBLISHED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { } break; case SCHEDULED: if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, site, properties); } else { properties.put("word_count", AnalyticsUtils.getWordCount(post.getContent())); properties.put("editor_source", shouldShowGutenbergEditor(post.isLocalDraft(), post) ? "gutenberg" : (AppPrefs.isAztecEditorEnabled() ? "aztec" : AppPrefs.isVisualEditorEnabled() ? "hybrid" : "legacy")); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SCHEDULED_POST, site, properties); } break; case DRAFT: properties.put("post_id", post.getRemotePostId()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(post.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_SAVED_DRAFT, site, properties); break; default: } }