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

Implement Stats Refresh analytics events #11757

Merged
10 commits merged into from May 23, 2019
Merged

Conversation

ghost
Copy link

@ghost ghost commented May 22, 2019

Summary

Fixes #11730.

To test:

  • Checkout the branch and confirm that existing tests pass, including those in WPAnalyticsTrackerAutomatticTracksTests.
  • Review the code changes, and confirm that everything looks square.
  • As a user, launch the app on-device or in the Simulator, logged in with Collect Information toggle enabled in Me : App Settings : Privacy Settings.
  • Step through the Stats functionality, taking note that these events are logged* as expected.

It's probably easiest to validate events in one of the following two ways:

  1. The event and properties are logged to the console here.
  2. You can search for the events in post via Tracks Live View. Once the events are captured, be sure they are sent across the wire. This is easiest to accomplish by backgrounding the app, initiated here.

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

Discussion

Absent explicit requirements, it took some time & energy to distill the specific changes that needed to be made. For this reason, I've chosen to chronicle my approach below. Please advise if I missed something!

  1. Examined the Android implementation of analytics; the PRs for these changes are noted in the issue.
  2. Defined the net new events in WPAnalytics.h (see WordPressShared).
  3. Absorbed these new events in WPiOS, ensuring that WPAnalytics.m prescribes eventName properties that match the aforementioned Android implementation.
  4. Implemented the events below:

"Legacy" Events

  • WPAnalyticsStatStatsInsightsAccessed
  • WPAnalyticsStatStatsPeriodDaysAccessed
  • WPAnalyticsStatStatsPeriodWeeksAccessed
  • WPAnalyticsStatStatsPeriodMonthsAccessed
  • WPAnalyticsStatStatsPeriodYearsAccessed
  • WPAnalyticsStatStatsScrolledToBottom
  • WPAnalyticsStatStatsSinglePostAccessed

Latest Post Summary Events

  • WPAnalyticsStatStatsItemTappedLatestPostSummaryNewPost
  • WPAnalyticsStatStatsItemTappedLatestPostSummaryPost
  • WPAnalyticsStatStatsItemTappedLatestPostSummarySharePost
  • WPAnalyticsStatStatsItemTappedLatestPostSummaryViewPostDetails

View More Events

  • WPAnalyticsStatStatsViewAllAccessed (legacy event)
  • WPAnalyticsStatStatsViewMoreTappedAuthors
  • WPAnalyticsStatStatsViewMoreTappedClicks
  • WPAnalyticsStatStatsViewMoreTappedComments
  • WPAnalyticsStatStatsViewMoreTappedCountries
  • WPAnalyticsStatStatsViewMoreTappedFollowers
  • WPAnalyticsStatStatsViewMoreTappedLatestPostSummary
  • WPAnalyticsStatStatsViewMoreTappedPostsAndPages
  • WPAnalyticsStatStatsViewMoreTappedPublicize
  • WPAnalyticsStatStatsViewMoreTappedReferrers
  • WPAnalyticsStatStatsViewMoreTappedSearchTerms
  • WPAnalyticsStatStatsViewMoreTappedTagsAndCategories
  • WPAnalyticsStatStatsViewMoreTappedVideoPlays

Additional Row Selection Events

  • WPAnalyticsStatStatsItemTappedAuthors
  • WPAnalyticsStatStatsItemTappedClicks
  • WPAnalyticsStatStatsItemTappedPostsAndPages
  • WPAnalyticsStatStatsItemTappedSearchTerms
  • WPAnalyticsStatStatsItemTappedSummaryPost
  • WPAnalyticsStatStatsItemTappedTagsAndCategories
  • WPAnalyticsStatStatsItemTappedVideoPlays

The following events required no changes:

  • WPAnalyticsStatStatsAccessed, still implemented in BlogDetailsViewController.
  • WPAnalyticsStatStatsOverviewBarChartTapped, implemented previously.

The following event(s) appear to be obsolete, and can be removed via #10975:

  • WPAnalyticsStatStatsTappedBarChart

@ghost ghost added this to the 12.6 milestone May 22, 2019
@ghost ghost requested a review from ScoutHarris May 22, 2019 22:22
@ghost ghost self-assigned this May 22, 2019
@ghost ghost added this to In progress in Full Stats Refresh via automation May 22, 2019
@ghost
Copy link
Author

ghost commented May 22, 2019

Once the backing PR in WordPressShared has been approved, we can initiate a new pod release and update the Podfile here to reference a proper version.

@ScoutHarris
Copy link
Contributor

Thanks for the details in the description @stevebaranski . That's very helpful!

@ScoutHarris
Copy link
Contributor

Hey Steve.

You can search for the events in post via Tracks Live View.

Are you sure dev tracks go there? I didn't see any. I used the Event Name wpios_stats% and only saw the legacy tracks from what appeared to be actual users. I didn't see any dev triggered tracks.

I do see them as Tracked in the logs, so I'm going to assume all is good, as I can't imagine why they wouldn't show in Tracks once published.

Full Stats Refresh automation moved this from In progress to Reviewer approved May 23, 2019
Copy link
Contributor

@ScoutHarris ScoutHarris left a comment

Choose a reason for hiding this comment

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

Looks good!

:shipit:

@ghost
Copy link
Author

ghost commented May 23, 2019

Thanks for the review, @ScoutHarris!

Are you sure dev tracks go there?

Yes, though there is generally some latency.

I took the liberty to express the same query for your username, and found some now. Hopefully that provides you some assurance that things are working as expected.

11757

In any case, I'll merge this once I take care of versioning WordPressShared.

@ScoutHarris
Copy link
Contributor

Yes, though there is generally some latency.

Ah! Apparently I wasn't patient enough. Thanks!

@ghost ghost merged commit 5585a8e into develop May 23, 2019
Full Stats Refresh automation moved this from Reviewer approved to Done May 23, 2019
@ghost ghost deleted the issue/11730-stats-refresh-tracks branch May 23, 2019 02:08
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

[Stats Refresh] Implement & validate analytics events
2 participants