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:
RNReactNativeGutenbergBridge.logUserEvent( name, properties )). The picker sends a page_template_applied event with the template name in properties.editor_session_template_apply event with a template property containing the name.editor_session_end event in a template property.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_appliedtopage_template_applythen? This only translates to thetemplateproperty ofeditor_session_endbut 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:
editor_session_template_preview with template propertyeditor_session_template_apply with template propertytemplate 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
Most helpful comment
Let's get this one going 馃帀
JS & iOS -> @chipsnyder
Android -> @mkevins