-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add Analytic event for "Lookup Dictionary" (see if we can remove it) #8263
Comments
I went through the code for
And also, just out of curiosity, how would this whole part function without the Lookup class? |
We'd remove it - I don't think the feature's used at all. UsageAnalytics.sendAnalyticsEvent(this.getClass().getSimpleName(), "enabled"); Pending further explanation by @mikehardy (I'll add this to the Development Guide, or code, as I wasn't aware and learned in passing a few days ago) The first argument is the category, and we may have a finite number of these(?), so we may want to standardise the input of this value |
Ok got it.
Oh, you mean in the development guide to AnkiDroid right? Also, when adding a new analytics event, how do we know that it has been added correctly? |
We have a dev version of Google Analytics which dev builds send data to - we'll work something out. Typically we can just check logs to see if it works. All in all, assume the API calls will be stable, and do some final testing afterwards.
Yeah - Analytics are an area of the code that I don't have much experience with. Mike's very knowledgeable, and it's best to share this knowledge for myself, and future developers in the guide. |
I just checked to see if categories were limited as it was vague in my mind as well. I do not believe there are finite categories https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#eventCategory So then it is just a question on how to log the data so that reports are meaningful. The only report I can easily create that shows "how much activity total there is" vs "how many times a user did a thing" is the engagement report that shows total screen views plus screens/session (so you can see about how many user sessions there were, easily) with event categories on the right (so you can see how many times a thing happened, and relate it to the number of user sessions) Which makes me think using a unique category is correct here, so you can answer the question "how many times is this used vs total app usage" For that purpose, I think using the Lookup classname is fine. For the value, probably including which dictionary was used would be useful - the idea for the event value is to include any other information that is useful when you have questions about the feature usage. For the widget that's just "enabled" or "disabled" - there is nothing more to know - but the dictionary usage has more information that might be interesting. |
If you turn on debugging for analytics, I think it logs out every event it sends? So you will see them going out in the logs - or you should - Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/analytics/UsageAnalytics.java Line 240 in 87d7f73
Trust the logs |
@mikehardy about this, how about we add analytics event to choosing a specific type of dictionary? Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Lookup.java Lines 44 to 48 in 87d7f73
For example, we add separate analytics event triggers in each of the cases of the switch construct and we make events this way ->
This way we can categorize the events for all dictionaries. |
@ritvij14 I think you would do it in this switch:
But otherwise, yes so I should expect to see Analytics hits of category "Lookup" with value "aedict" etc |
Alright got it. I will get started on this and send a PR soon. One more thing, how should I test out the additions of analytics changes locally? |
@ritvij14 watch logcat, and if the analytics logs indicate the event is being logged, it will be logged, you may trust it. |
@mikehardy for this part I am getting a very small log, and there is no mention of analytics events being logged in here :-
There should be some log for |
In debug builds I believe you need to go into advanced settings and toggle on debug analytics, can you try that? And if so please add a note about this requirement on #8284 as we try to document this better |
@mikehardy I got the problem. So what I did was, in the Preferences class, under the case of advanced settings, I added an extra onPreferenceChangeListener for dictionary preference. And now, when the user chooses a dictionary, it automatically sends an action to analytics.
I have also added these changes to my PR #8283. |
* added analytic event triggers to Lookup.java fix for #8263
I don't think the feature is used. It's 10 years old, esoteric, hard to access, and probably deprecated by the share/system context menu.
It adds complexity to
AbstractFlashcardViewer
, and may be better as a separate app to allow system-wide usage, instead of an AnkiDroid specific feature.I would like an analytic event to see if users still use it, to argue for its removal in 2.16
Likely entry point:
Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Lookup.java
Lines 78 to 83 in a079a61
The text was updated successfully, but these errors were encountered: