This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Conversation
hamorillo
commented
Jun 17, 2025
|
|
||
| override fun trackEvent(event: Event) { | ||
| // We should add GRAVATAR userType when available. | ||
| tracksClient.track(event.name, userId ?: anonId, TracksClient.NosaraUserType.ANON) |
Author
There was a problem hiding this comment.
We should refactor the code when NosaraUserType.GRAVATAR is available.
Contributor
There was a problem hiding this comment.
Do you know when we will have it?
Author
There was a problem hiding this comment.
Not yet. If there are no changes in the PR today, I'll ask for the review and an estimated time for the new release.
55ea667 to
99e6d4f
Compare
hamorillo
commented
Jun 17, 2025
| @Suppress("FunctionOnlyReturningConstant") | ||
| fun getName(): String { | ||
| return "Gravatar" | ||
| val userId = "Gravatar" |
Author
There was a problem hiding this comment.
This hardcoded Gravatar should be replaced with the Gravatar UserID when we implement the OAuth flow.
Author
There was a problem hiding this comment.
Update: We'll need to use the WPCOM userName here.
Contributor
AdamGrzybkowski
left a comment
There was a problem hiding this comment.
Looks good 👍 Left some clarifying comments.
| package com.gravatar.analytics | ||
|
|
||
| interface Event { | ||
| val name: String |
Contributor
There was a problem hiding this comment.
We will likely need a way to pass some params as well.
analytics/src/test/kotlin/com/gravatar/analytics/di/AnalyticsModuleTest.kt
Show resolved
Hide resolved
analytics/src/test/kotlin/com/gravatar/analytics/tracks/TrackTrackerTest.kt
Outdated
Show resolved
Hide resolved
analytics/src/test/kotlin/com/gravatar/analytics/tracks/TrackTrackerTest.kt
Outdated
Show resolved
Hide resolved
The first version of the Tracker is being injected in the app module, more concretely in the test viewmodel to check that everything works as expected.
3873000 to
93412be
Compare
AdamGrzybkowski
approved these changes
Jun 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR creates a new module (
analytics) to encapsulate the code related to analytic events. Track library doesn't have a userType for Gravatar, so I've opened a PR to add it. (We'll need to update our app when the PR is merged and the new release is published.)If we agree to merge this PR, I'll create a ticket to ensure we don't forget about it.
Testing Steps
gravatarandroid%should be enough to verify that the event is being sent to the backend. Another option could be to verify that the device makes the network request.Note: The event takes some time to appear in Tracks. Based on my experience, it could take more than 15 minutes.