Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tracking to recommend the app feature. #15277

Merged
merged 12 commits into from
Sep 3, 2021

Conversation

develric
Copy link
Contributor

@develric develric commented Sep 3, 2021

Refs: pctCYC-8X-p2#comment-340 and iOS counter part PR

Part of #15269 this PR does the following:

  • Adds tracking for recommend_app_engaged: this event is fired when the Share Sheet is succesfully opened: it has a source parameter that currently is only triggered for "me" given the "about" source is not available
  • Adds tracking for recommend_app_content_fetch_failed: this event is fired on failure in getting the remote template; it has a source parameter (only "me" available) and an error parameter that reports the error message. Currently the failure is triggered for
    • No network available
    • Volley network error
    • getTemplateFromJson parsing error
  • A bit of refactor of calls provider to ease testability and moving the No network check inside the net calls provider so to have all failure causes in one place inside that class; also it seemed to me a good place where to check for network in the end.

To test

  • Activate the feature flag and the tracking in the app settings and look in logcat for events
  • Check the following is triggered on success when opening the sheet (both when network call happens and in successive taps on the share button without leaving the Me screen)
🔵 Tracked: recommend_app_engaged, Properties: {"source":"me"}
  • Check therecommend_app_content_fetch_failed event is triggered on following failures:
    • No Network available: setting the airplane mode you should get
🔵 Tracked: recommend_app_content_fetch_failed, Properties: {"source":"me","error":"getRecommendTemplate > No Network available"}
  • Volley network error, getTemplateFromJson parsing error: forcing conditions with debugger or by charles proxy (error property will depend on how the error is forced)
  • Since a bit of refactoring was made, smoke test the feature.

Regression Notes

  1. Potential unintended areas of impact
    None.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual testing and unit testing added.

  3. What automated tests I added (or what prevented me from doing so)
    Unit testing for tracking added.

PR submission checklist:

  • I have completed the Regression Notes.
  • 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.

@develric develric added this to the 18.2 milestone Sep 3, 2021
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Sep 3, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Sep 3, 2021

You can test the changes on this Pull Request by downloading the APKs:

@develric develric added Tooling and removed Tooling labels Sep 3, 2021
@develric develric marked this pull request as ready for review September 3, 2021 13:31
@develric develric added Tooling and removed Tooling labels Sep 3, 2021
Copy link
Member

@renanferrari renanferrari left a comment

Choose a reason for hiding this comment

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

Hey @develric 👋 Thanks for the changes! I have tested the app and can confirm I see the correct messages on logcat both on success and failure. Code is looking pretty good as well! I just left two comments below with a typo I found and a suggestion for a very minor improvement.

As we chatted on Slack, it seems that the recommend_app_content_fetch_failed event only shows up on Tracks if we remove the error property from it, so it seems that there's something that needs to be done there.

Other than that, everything looks good to go.

Copy link
Member

@renanferrari renanferrari left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

Feel free to merge this once all checks are ok.

@develric
Copy link
Contributor Author

develric commented Sep 3, 2021

Thanks @renanferrari for helping with the reviews of these PRs, much appreciated 🙇 ! Just leaving a note that as far as we got, to fix the recommend_app_content_fetch_failed we needed to avoid using the error string as a key for tracking property. Changing it to cause_of_issue the event started to appear in tracks 🤷 ...cc @jkmassel in case it was a known issue or for any further insights 🙇

@develric develric merged commit 13fcc01 into develop Sep 3, 2021
@develric develric deleted the feature/recommend-the-app-tracking branch September 3, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants