Skip to content

Adding Tracks Event for Suggestions UI#13622

Merged
mchowning merged 1 commit intoxpost_suggestionsfrom
xpost_tracks
Dec 22, 2020
Merged

Adding Tracks Event for Suggestions UI#13622
mchowning merged 1 commit intoxpost_suggestionsfrom
xpost_tracks

Conversation

@mchowning
Copy link
Copy Markdown
Contributor

@mchowning mchowning commented Dec 16, 2020

This adds a track event for usage of the suggestions UI.

To Test

Make sure you have Me -> App Settings -> Privacy Settings -> Collect Information. Personally, when working with tracks I like to leave that unchecked and spend 30 minutes debugging the code to figure out why tracks aren't working before I realize that is unchecked, but I understand if you want to skip straight to flipping the toggle 😉 🤣 .

All of the tests below should be done with both (a) xposts and (b) user-mentions. In all the tests, the event should have a suggestion_type property with a value of either "xpost" or "user" as appropriate.

This event still needs to be marked as valid in the Tracks directory. Please either do that as part of reviewing this PR, or remind me that it still needs to be done, and I'm happy to take care of it once this PR is approved. 🙇

Related: p9ugOq-1tR-p2

1. Successfully select a suggestion

  1. Select a P2 site
  2. Open the suggestions UI by typing a +/@ or tapping the suggestions button on the format bar.
  3. Select a suggestion by either (a) tapping on one of the available suggestions, or (b) filtering the list to a single suggestion and pressing enter
  4. Observe that the appropriate track event ("suggestion_session_finished") is sent with did_select_suggestion as true and an appropriate suggestion_type.

2. Exiting without selecting a suggestion

  1. Select a P2 site
  2. Open the suggestions UI by typing a +/@ or tapping the suggestions button on the format bar.
  3. Exit the suggestions UI by either
    1. Pressing backspace before entering any text in the suggestion UI;
    2. Filtering the list of suggestions so it does not take up the full screen and tapping "behind" the suggestions UI (i.e., on the block editor you can see in the background); or
    3. Using the back button/swipe. Note that if the keyboard is shown you will probably have to swipe back two times (first time closes the keyboard and second time exits the suggestions UI), but an event should only be sent when you exit the suggestions UI.
  4. Observe that the appropriate track event ("suggestion_session_finished") is sent with did_select_suggestion as false and an appropriate suggestion_type.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@mchowning mchowning added this to the 16.5 milestone Dec 16, 2020
@mchowning mchowning requested a review from guarani December 16, 2020 23:28
@peril-wordpress-mobile
Copy link
Copy Markdown

You can test the changes on this Pull Request by downloading the APK here.

@mchowning mchowning marked this pull request as ready for review December 17, 2020 15:06
@jd-alexander jd-alexander self-assigned this Dec 17, 2020
Copy link
Copy Markdown
Contributor

@jd-alexander jd-alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mchowning the code looks good and I didn't notice any issues.

I tested both the user and xpost mentioning behavior and they worked as expected. I saw the entries in the logs as well depending on what I was testing eg.

2020-12-17 13:35:34.167 6161-6161/org.wordpress.android.beta I/WordPress-STATS: 🔵 Tracked: suggestion_session_finished, Properties: {"did_select_suggestion":true,"suggestion_type":"user"}
2020-12-17 13:51:59.540 6907-6907/org.wordpress.android.beta I/WordPress-STATS: 🔵 Tracked: suggestion_session_finished, Properties: {"did_select_suggestion":true,"suggestion_type":"xpost"}

This event still needs to be marked as valid in the Tracks directory

If you could take care of this, I would gladly appreciate it 🙇‍♂️

LGTM 🚢

@mchowning
Copy link
Copy Markdown
Contributor Author

If you could take care of this, I would gladly appreciate it

I'm happy to take care of that. Thanks for the review @jd-alexander !

@mchowning
Copy link
Copy Markdown
Contributor Author

Just noting that I'm holding off on merging this until the underlying xposts PR is merged.

@mchowning mchowning mentioned this pull request Dec 18, 2020
3 tasks
@mchowning
Copy link
Copy Markdown
Contributor Author

Just noting that I'm holding off on merging this until the underlying xposts PR is merged.

Decided to go ahead and merge into that PR branch now that both are approved. This way we just have a single merge into develop instead of two merges.

@mchowning mchowning merged commit 91cb68b into xpost_suggestions Dec 22, 2020
@mchowning mchowning deleted the xpost_tracks branch December 22, 2020 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants