Gutenberg-mobile: Add metrics for SPTs

Created on 12 Feb 2020  路  7Comments  路  Source: wordpress-mobile/gutenberg-mobile

We should be able to track when a template was applied in an editor session.

I initially thought about using a @wordpress/data plugin to hook into store actions, but considering that the feature is mobile only for now, it would be much simpler to just fire an event from the picker directly.

How I imagine this working:

  1. We add a method to the bridge to send user actions to the apps (RNReactNativeGutenbergBridge.logUserEvent( name, properties )). The picker sends a page_template_applied event with the template name in properties.
  2. When the template picker applies a template, it calls this bridge method.
  3. The apps fire a editor_session_template_apply event with a template property containing the name.
  4. The apps keep track of the last applied template in the editor session (iOS, Android), and include it as part of the editor_session_end event in a template property.
Analytics Page Templates

Most helpful comment

Let's get this one going 馃帀

JS & iOS -> @chipsnyder
Android -> @mkevins

All 7 comments

Let's get this one going 馃帀

JS & iOS -> @chipsnyder
Android -> @mkevins

@mkevins I drafted up the PRs for gutenberg > gutenberg-mobile > iOS. If anything looks off or needs some tweaks for Android then feel free to modify them

After chatting with @pinarol, we could use an extra event when a template is previewed (editor_session_template_preview with a template property) so we can understand better if individual templates are meeting expectations.

Also, for consistency with the existing session events (i.e. switch_editor), let's rename editor_session_template_applied to editor_session_template_apply.

@koke

Also, for consistency with the existing session events (i.e. switch_editor), let's rename editor_session_template_applied to editor_session_template_apply.

Should we rename page_template_applied to page_template_apply then? This only translates to the template property of editor_session_end but wanted to check.

For editor_session_template_apply what do you think about editor_session_template_preview instead? I think this helps clarify the use of the field and how it's different from the other event.

Should we rename page_template_applied to page_template_apply then? This only translates to the template property of editor_session_end but wanted to check

We should also be sending a separate editor_session_template_apply event when that happens.

For editor_session_template_apply what do you think about editor_session_template_preview instead?

馃う鈥嶁檪 I just saw that, I wrote the wrong thing there, sorry. To summarize the changes:

  • When a template preview is opened, send editor_session_template_preview with template property
  • When a template is applied, send editor_session_template_apply with template property
  • When a session ends, include a template property with the last template applied.

@koke The changes you mentioned here https://github.com/wordpress-mobile/gutenberg-mobile/issues/1883#issuecomment-590247803 should be good to go now in the iOS stream of PRs

Was this page helpful?
0 / 5 - 0 ratings