Skip to content

Commit

Permalink
Merge branch 'feature/analytics_documentation' into feature/analytic_…
Browse files Browse the repository at this point in the history
…across_the_app
  • Loading branch information
nowakweronika committed Dec 5, 2023
2 parents ef3bd73 + 41cc3d8 commit 27abadc
Show file tree
Hide file tree
Showing 37 changed files with 337 additions and 6 deletions.
19 changes: 13 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,11 @@ 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

Google Analytics serves as an application measurement solution, offering valuable insights into app
utilization and user engagement. Check out our [Analytics Documentation](docs/analytics.md)!

## 🧑🏻‍🎓 Contributing

We believe that there is no ideal code and that every code can be improved. Therefore, we welcome
Expand Down
57 changes: 57 additions & 0 deletions docs/analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## 🧐 Firebase Analytics

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. | ![Last 30 minutes](analytics_imgs/reviewers/last_30_mins.png) |
| List of events from the selected period. | ![List of events](analytics_imgs/reviewers/list_of_events.png) |
| When you click on an event, you can see more detailed information. | ![Detailed information](analytics_imgs/reviewers/detailed_info.png) |

### 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 | Parameters | Description |
|:---------------------------------------------------:|-----------------------|---------------------------------------------------|
| [button_click](event_details/button_click.md) | item_name | Fired when a user clicked on a button or link. |
| [action_start](event_details/action_start.md) | item_name | Fired when we want to track start/finish actions. |
| [action_finished](event_details/action_finished.md) | item_name<br/>success | Called when the action_start is finished. |
| [simple_action](event_details/simple_action.md) | item_name | Fired when single actions is happening. |
| [screen_opened](event_details/screen_opened.md) | item_name | Called when screen is opened. |

**Screens**
* [Reviewers Screen](screens/reviewers_screen.md)
* [Pull Requests Screen](screens/pullrequests_screen.md)
* [Login Screen](screens/login_screen.md)
* [Authenticating](screens/authenticating.md)
Binary file added docs/analytics_imgs/login/github_auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics_imgs/login/login_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics_imgs/pull_requests/fetch_prs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics_imgs/reviewers/detailed_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics_imgs/reviewers/last_30_mins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics_imgs/reviewers/list_of_events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/analytics_imgs/reviewers/pull_to_refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions docs/event_details/action_finished.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# action_finished

## When the event is called

Called when the "action_start" is finished.

## Parameters

- event_name (required) - Always “action_finished”.
- item_name (required) - Unique action name. The same value as in "action_start".
- success (required) - True if action succeeded and false if not.

## Examples

```json
{
"event_name": "action_finished",
"item_name": "Downloading User Profile",
"success": true,
}
```

or

```json
{
"event_name": "action_finished",
"item_name": "Downloading User Profile",
"success": false,
}
```

## Why this metric is tracked

- We can measure how many interactions has finished.
- We can measure how many actions were successful.
- In case of debugging errors, we can measure user interactions that are preceding the failure event.
24 changes: 24 additions & 0 deletions docs/event_details/action_start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# action_start

## When the event is called

This event should be tracked only if is followed by action_finished event. If you don’t want to track finish, you should use simple_action event.

## Parameters

- event_name (required) - Always “action_start”.
- item_name (required) - Unique action name. The same item_name should be used in action_finished event.

## Examples

```json
{
"event_name": "action_start",
"item_name": "Downloading User Profile"
}
```

## Why this metric is tracked

- We can measure how many interactions has started.
- By checking "action_finished", we can measure how many actions were successful.
25 changes: 25 additions & 0 deletions docs/event_details/button_click.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# button_click

## When the event is called

Fired when a user clicked on a button or link.

## Parameters

- event_name (required) - Always “button_click”.
- item_name (required) - Name of the button or link that user clicked. Keep in mind, it should uniquely identify every button on every screen. So if there are two buttons with the same name, you need to add some suffix to the event. If the text on the button changes, it’s usually better to keep the “item_name” the same, so we can keep analytics dashboard simpler.

## Examples

```json
{
"event_name": "button_click",
"item_name": "Check-in button",
}
```

## Why this metric is tracked

- We can check if users clicks on given button/link.
- We can check what buttons are most important for our users.
- By very low conversion, we might find an opportunity for improving the button placement or UI.
23 changes: 23 additions & 0 deletions docs/event_details/screen_opened.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# screen_opened

## When the event is called

If you’d like to track when screen is opened.

## Parameters

- event_name (required) - Always “screen_opened”.
- item_name (required) - Unique name of the screen that is opened.

## Examples

```json
{
"event_name": "screen_opened",
"item_name": "reviewers_screen"
}
```

## Why this metric is tracked

- We can track when user open screen.
24 changes: 24 additions & 0 deletions docs/event_details/simple_action.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# simple_action

## When the event is called

If you’d like to track action start and action finish. You should use "action_start" events.

## Parameters

- event_name (required) - Always “simple_action”.
- item_name (required) - Unique name of the action that is happening.

## Examples

```json
{
"event_name": "simple_action",
"item_name": "User is checked-in"
}
```

## Why this metric is tracked

- We can track important interactions within the app and measure its occurrences.
- Can be used for measuring important conversions.
27 changes: 27 additions & 0 deletions docs/screens/authenticating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Authenticating

## Documentation

| When authentication started. | <pre>{<br /> "name": "action_start"<br /> "item_name": "authentication"<br />}<pre/> |
|:----------------------------:|------------------------------------------------------------------------------------------|

| When authentication finished with success. | <pre>{<br /> "name": "action_finished"<br /> "item_name": "authentication"<br /> "success": true<br />}<pre/> |
|:------------------------------------------:|---------------------------------------------------------------------------------------------------------------------|

| When authentication finished with failure. | <pre>{<br /> "name": "action_finished"<br /> "item_name": "authentication"<br /> "success": false<br />}<pre/> |
|:------------------------------------------:|----------------------------------------------------------------------------------------------------------------------|

| When get access token started. | <pre>{<br /> "name": "action_start"<br /> "item_name": "get_access_token"<br />}<pre/> |
|:------------------------------:|--------------------------------------------------------------------------------------------|

| When get access token finished with success. | <pre>{<br /> "name": "action_finished"<br /> "item_name": "get_access_token"<br /> "success": true<br />}<pre/> |
|:--------------------------------------------:|-----------------------------------------------------------------------------------------------------------------------|

| When get access token finished with failure. | <pre>{<br /> "name": "action_finished"<br /> "item_name": "get_access_token"<br /> "success": false<br />}<pre/> |
|:--------------------------------------------:|------------------------------------------------------------------------------------------------------------------------|

| When login error is shown. | <pre>{<br /> "name": "screen_opened"<br /> "item_name": "login_error"<br />}<pre/> |
|:--------------------------:|----------------------------------------------------------------------------------------|

| When generic error is shown. | <pre>{<br /> "name": "screen_opened"<br /> "item_name": "generic_error"<br />}<pre/> |
|:----------------------------:|------------------------------------------------------------------------------------------|
29 changes: 29 additions & 0 deletions docs/screens/login_screen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Login Screen

<img src="../analytics_imgs/login/login_screen.png" width=20% height=20%>

## Documentation

| When user clicks log in. | Specification |
|:-------------------------------------------------------------------------:|----------------------------------------------------------------------------------|
| <img src="../analytics_imgs/login/login_screen.png" width=50% height=50%> | <pre>{<br /> "name": "button_click"<br /> "item_name": "log_in"<br />}<pre/> |

| When github auth opens. | Specification |
|:------------------------------------------------------------------------:|---------------------------------------------------------------------------------------------|
| <img src="../analytics_imgs/login/github_auth.png" width=50% height=50%> | <pre>{<br /> "name": "simple_action"<br /> "item_name": "open_github_auth"<br />}<pre/> |

| When user clicks log in on xiaomi device. | Specification |
|:-------------------------------------------------------------------------------------:|----------------------------------------------------------------------------------------------------------|
| <img src="../analytics_imgs/login/xiaomi_permission_dialog.png" width=50% height=50%> | <pre>{<br /> "name": "simple_action"<br /> "item_name": "show_xiaomi_permission_dialog"<br />}<pre/> |

| When user dismiss permission dialog. | Specification |
|:------------------------------------------------------------------------------------:|---------------------------------------------------------------------------------------------------------------|
| <img src="../analytics_imgs/login/xiaomi_dialog_dismissed.png" width=50% height=50%> | <pre>{<br /> "name": "simple_action"<br /> "item_name": "xiaomi_permission_dialog_dismissed"<br />}<pre/> |

| When user clicks grant on permission dialog. | Specification |
|:--------------------------------------------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------|
| <img src="../analytics_imgs/login/xiaomi_permission_granted.png" width=50% height=50%> | <pre>{<br /> "name": "simple_action"<br /> "item_name": "xiaomi_permission_dialog_permission_granted"<br />}<pre/> |

| When user clicks already granted on permission dialog. | Specification |
|:----------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------------------------------|
| <img src="../analytics_imgs/login/xiaomi_permission_already_granted.png" width=50% height=50%> | <pre>{<br /> "name": "simple_action"<br /> "item_name": "xiaomi_permission_dialog_permission_already_granted"<br />}<pre/> |
Loading

0 comments on commit 27abadc

Please sign in to comment.