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

[LD-146] Analytics Documentation #178

Merged
105 changes: 99 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ experiments with different development libraries and tools.
- Jetpack Compose
- Koin
- Kotlin Coroutines
- Retrofit
- Ktor
- OkHttp3
- Gson
- Kotlin Serialization

## 🔬 Experiments, the purpose of the project

Expand Down Expand Up @@ -61,7 +61,8 @@ Here's an example of an experiment that meets our rules:

**Branch Name:** experiment/navigation-by-voyager-library\
**Purpose:** Check compose navigation with voyager library. Compare that with standard way.\
**Goal:** To resolve which navigation is better for compose. What are the pros and cons of each way.\
**Goal:** To resolve which navigation is better for compose. What are the pros and cons of each
way.\
**Method:** Implement navigation with voyager library.

## 🚀 Project setup
Expand All @@ -71,8 +72,8 @@ In order to properly start the application and use it, the `LOUDIUS_CLIENT_SECRE

* `LOUDIUS_CLIENT_SECRET` is a GitHub client secret key
* `LOUDIUS_CLIENT_ID` is a GitHub client id
*
both are provided from ``Settings -> Developer Settings -> OAuth Apps -> my application``.

Both are provided from ``Settings -> Developer Settings -> OAuth Apps -> my application``.

If you're not AppUniter, here's a video to help you create such appliation:

Expand All @@ -82,7 +83,8 @@ If you'd like to run end-to-end tests you'd also need `LOUDIUS_GITHUB_USER_NAME`
`LOUDIUS_GITHUB_USER_PASSWORD` which are credentials to GitHub test account.
This is just a standard GitHub account that you can create by yourself.

If you're AppUniter, you can find those secrets [here](https://www.notion.so/appunite/Github-Secrets-0c2c6c1b56e2472c8a4752241f1e20d3?pvs=4).
If you're AppUniter, you can find those
secrets [here](https://www.notion.so/appunite/Github-Secrets-0c2c6c1b56e2472c8a4752241f1e20d3?pvs=4).

### How to set environmental variable on mac?

Expand All @@ -103,6 +105,97 @@ To do that - add `[New snapshots]` to the pull request title. Otherwise the snap

We also are having [design system documentation](components/README.md).

## 🧐 Firebase Analytics
Copy link
Member

@jacek-marchwicki jacek-marchwicki Nov 28, 2023

Choose a reason for hiding this comment

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

suggestion:

  1. Let's move to a different file so our main README file doesn't contain too much data. e.g. [Analytics Documentation](docs/analytics.md)

  2. It would be good to have images in the repo, so we can do normal code-review process. So move images to GitHub repo docs/analytics-imgs/users-in-last-30-minues.png

  3. "Events Names" documentation, should have more information about every specific event. You can look at button_click. We should know details when something is tracked, what parameters are required. Some examples, etc.

  4. Afaik, it would be good if every screen would have its own custom README page, e.g. docs/anlaytics/page/reviewers-screen.md

  5. As a start section of a given screen, it's good to add a screenshot of that page, so it's easier to know exactly what screen we're referring in the following events.

  6. You can consider displaying images a little bit smaller, because knowing precise content is not so important, but those images take a lot of page layout.


Google Analytics serves as an application measurement solution, offering valuable insights into app
utilization and user engagement.

Google Analytics helps you see how people use your Android app. It automatically tracks different
actions and user details. You can even create your own custom events to measure things that are
important to your app. Once it collects this info, you can check it out on a dashboard in the
Firebase console.

| Description | Picture |
|:------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Users in last 30 minutes. | <img width="401" alt="Screenshot 2023-10-30 at 15 06 42" src="https://github.com/appunite/Loudius/assets/72873966/ac32815f-4493-44e3-bce2-5a8ef8a8608d"> |
| List of events from the selected period. | <img width="398" alt="Screenshot 2023-10-30 at 15 06 52" src="https://github.com/appunite/Loudius/assets/72873966/06087e06-30b2-44c9-ae93-aefae7ad2d4f"> |
| When you click on an event, you can see more detailed information. | <img width="1440" alt="Screenshot 2023-10-30 at 15 11 03" src="https://github.com/appunite/Loudius/assets/72873966/bae5e0ef-0ce3-4ed6-a65e-e838c15e55d5"> |

### How to test?

First, you should add commands to terminal which allow you logging events.

```
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
```

Last command will print logs for the device.
If you have problems with adb command, those links can
help: [Not found adb Error](https://dev.to/ravics09/solution-of-command-not-found-adb-error-29e7)
and [StackOverflow question](https://stackoverflow.com/questions/50456824/adb-command-not-found-on-mac-computer).
Then, you can open the app and start testing! You should be able to see relevant events in Logcat.

**❗️Be aware that you won't see analytics on dashboard immediately. Firebase needs about a few hours
to note it.❗️**

### Documentation

**Analytics Parameters**

| Event parameter name | Type | Examples | Description |
|:--------------------:|:-------:|:--------------:|:---------------------------------------------------------------:|
| name | String | "button_click" | An important event in the application that you want to measure. |
| item_name | String | "notify" | Name of item that user interacted with during an event. |
| success | Boolean | `true` | Information whether the action was successful. |

**Event Names**

| Event name | Description |
|:---------------:|:-------------------------------------------------:|
| button_click | Fired when a user clicked on a button or link. |
| action_finished | Fired when “action_start” is finished. |
| action_start | Fired when we want to track start/finish actions. |

**Reviewers Screen**

| When user clicks notify. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|----------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 03 14](https://github.com/appunite/Loudius/assets/72873966/10e1414f-f6d4-44c8-965c-cb91e8230fb8) | <pre>{<br /> "name": "button_click"<br /> "item_name": "notify"<br />}<pre/> |

| After user clicks notify, action finished with success. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|-------------------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 22 36](https://github.com/appunite/Loudius/assets/72873966/ad716d96-ff6b-41a6-a13a-ce265baa55a8) | <pre>{<br /> "name": "action_finished"<br /> "item_name": "notify"<br /> "success": true<br />}<pre/> |

| After user clicks notify, action finished with error. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 24 38](https://github.com/appunite/Loudius/assets/72873966/898be31d-8a23-425a-997d-363d9aa58b99) | <pre>{<br /> "name": "action_finished"<br /> "item_name": "notify"<br /> "success": false<br />}<pre/> |

| When user pulls to refresh. | Specification |
|:----------------------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------|
| ![Frame-24-11-2023-01-33-33](https://github.com/appunite/Loudius/assets/72873966/c0b8b5f3-1a95-433e-856d-a5b3e396079e) | <pre>{<br /> "name": "action_start"<br /> "item_name": "refresh_reviewers_data"<br />}<pre/> |

| When refresh data finished with success. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|-----------------------------------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 53 27](https://github.com/appunite/Loudius/assets/72873966/6abf8266-af26-41a6-b9cb-689dcd7c197f) | <pre>{<br /> "name": "action_finished"<br /> "item_name": "refresh_reviewers_data"<br /> "success": true<br />}<pre/> |

| When refresh data finished with error. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 54 26](https://github.com/appunite/Loudius/assets/72873966/84d22828-eef2-4d3d-b613-208744edea19) | <pre>{<br /> "name": "action_finished"<br /> "item_name": "refresh_reviewers_data"<br /> "success": false<br />}<pre/> |

| When user opens reviewers screen. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 53 27](https://github.com/appunite/Loudius/assets/72873966/6abf8266-af26-41a6-b9cb-689dcd7c197f) | <pre>{<br /> "name": "action_start"<br /> "item_name": "fetch_reviewers_data"<br />}<pre/> |

| When refresh data finished with success. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|---------------------------------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 53 27](https://github.com/appunite/Loudius/assets/72873966/6abf8266-af26-41a6-b9cb-689dcd7c197f) | <pre>{<br /> "name": "action_finished"<br /> "item_name": "fetch_reviewers_data"<br /> "success": true<br />}<pre/> |

| When refresh data finished with error. | Specification |
|:------------------------------------------------------------------------------------------------------------------------------:|----------------------------------------------------------------------------------------------------------------------------|
| ![Screenshot 2023-11-24 at 13 54 26](https://github.com/appunite/Loudius/assets/72873966/84d22828-eef2-4d3d-b613-208744edea19) | <pre>{<br /> "name": "action_finished"<br /> "item_name": "fetch_reviewers_data"<br /> "success": false<br />}<pre/> |

## 🧑🏻‍🎓 Contributing

We believe that there is no ideal code and that every code can be improved. Therefore, we welcome
Expand Down