Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,12 @@ private void newPostSetup() {
mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST);
}

private void createPostEditorAnalyticsSessionTracker(boolean showGutenbergEditor, PostModel post, SiteModel site) {
private void createPostEditorAnalyticsSessionTracker(boolean showGutenbergEditor, PostModel post, SiteModel site,
boolean isNewPost) {
if (mPostEditorAnalyticsSession == null) {
mPostEditorAnalyticsSession = new PostEditorAnalyticsSession(
showGutenbergEditor ? Editor.GUTENBERG : Editor.CLASSIC,
post, site);
post, site, isNewPost);
}
}

Expand Down Expand Up @@ -531,7 +532,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

// ok now we are sure to have both a valid Post and showGutenberg flag, let's start the editing session tracker
createPostEditorAnalyticsSessionTracker(mShowGutenbergEditor, mPost, mSite);
createPostEditorAnalyticsSessionTracker(mShowGutenbergEditor, mPost, mSite, mIsNewPost);

// Bump post created analytics only once, first time the editor is opened
if (mIsNewPost && savedInstanceState == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.wordpress.android.ui.posts;

import android.text.TextUtils;

import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.analytics.AnalyticsTracker.Stat;
import org.wordpress.android.fluxc.model.PostModel;
Expand Down Expand Up @@ -47,7 +45,7 @@ enum Outcome {
PUBLISH
}

PostEditorAnalyticsSession(Editor editor, PostModel post, SiteModel site) {
PostEditorAnalyticsSession(Editor editor, PostModel post, SiteModel site, boolean isNewPost) {
// fill in which the current Editor is
mCurrentEditor = editor;

Expand All @@ -69,7 +67,7 @@ enum Outcome {

// fill in mContentType
String postContent = post.getContent();
if (TextUtils.isEmpty(post.getContent())) {
if (isNewPost) {
mContentType = "new";
} else if (PostUtils.contentContainsGutenbergBlocks(postContent)) {
mContentType = "gutenberg";
Expand Down