Skip to content
Snippets Groups Projects
Commit 9166e6b0 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

removed: konnector-attempts

parent 3de996f1
No related branches found
No related tags found
1 merge request!57feat: cleaned dacc indicators
Pipeline #90581 passed
......@@ -27,7 +27,6 @@ This section explains how the application is tracking usage events. Here are the
| --- | --- | --- | --- | --- | --- | --- | --- |
| Complétion d'un nouveau profile | ProfileSetEvent | --- | --- | --- | --- | Lors de l'affichage de la page de félicitation profileTypeFinished | navigation-action-daily |
| Consultation du nouveau bilan mensuel | ReportFromEvent | --- | 'analysis' | --- | 1 | Lorsque l'utilisateur consulte sa page analyse quand la notification est activée | summary-subscription-monthly |
| Tentative de connexion à un connecteur (initialisation)| KonnectorAttemptEvent | Slug du connecteur | --- | --- | 'success or error' | Lorsque l'utilisateur clique sur le bouton de connexion. Lorsque la connexion est réussie, et que l'utilisateur clique sur OK dans la modale le *result* est passé à 'success' | konnector-attempts-monthly |
## Indicators
......@@ -48,7 +47,6 @@ All monthly indicators call can be found after this comment on the code
| summary-subscription-monthly | Tous les mois si un utilisateur a souscrit a la newsletter ou c'est désabonné | 1 si l’utilisateur est inscrit sinon 0 |
| fluid-data-granularity-monthly | Tous les mois sans condition | 1 si l'utilisateur possède de la donnée a la demi heure sur le mois. Sinon 0 |
| profile-count-monthly | Tous les mois si le profil a été complété au moins une fois | Le nombre de fois ou le profile a été complété |
| konnector-attempts-monthly | Tous les mois, le nombre de tentative de connexion pour connecter un connecteur la première fois. Une fois la connexion réussie, l'indicateur remonte true dans le groupe "success". L'indicateur ne remonte ensuite plus pour cet utilisateur car il aura déjà réussi à se connecter une première fois. | Le nombre total de tentatives |
### Daily Indicators
......
# Usage events tracking
This section explains how the application is tracking usage events. Here are the main step:
- All events are stored during the use of the application in the doctype **com.grandlyon.ecolyo.usageevents**
- A service is responsible of the aggregation of these events to create ANONYMIZED indicators. These indicators are then sent to a remote docType.
## Usage events collection
During the use of the application we stored some events link to an user action. Here are the list of collected usage events:
| Category | Type | Target | Result | Context | Description |
| ----------- | ------------------------------ | -------------- | -------------------- | --------------------- | ----------------------------------------- |
| Connection | ConnectionEvent | | | "desktop" or "mobile" | User connects to the application. |
| Navigation | NavigationEvent | Page_name | | | User navigates to a targeted page. |
| Konnector | KonnectorConnectEvent | Konnector_slug | "success" or "error" | | User connects a konnector. |
| Konnector | KonnectorRefreshEvent | Konnector_slug | "success" or "error" | | User refreshes a konnector. |
| Challenge | ChallengeLaunchEvent | Challenge_id | | | User launches a challenge. |
| Challenge | ChallengeEndEvent | Challenge_id | | | User ends a challenge. |
| Duel | DuelLaunchEvent | Duel_id | | Challenge_id | User launches a duel. |
| Duel | DuelEndEvent | Duel_id | | Challenge_id | User ends a duel. |
| Quiz | QuizEndEvent | Quiz_id | starsNumber | Challenge_id | User ends a quiz. |
| Exploration | ExplorationEndEvent | Exploration_id | | Challenge_id | User ends an exploration. |
| Action | ActionChangeEvent | Action_id | | Challenge_id | User change action's ecogesture. |
| Action | ActionEndEvent | Action_id | | Challenge_id | User ends a action. |
| Profile | ProfileSetEvent | | | | User fills in its profile. |
| Consumption | ConsumptionCompareEvent | | | Fluid / TimeStep | User compares its consumption. |
| Consumption | ConsumptionChangeTimeStepEvent | TimeStep | | Fluid | User changes timeStep of its consumption. |
| Consumption | ConsumptionInteracteEvent | | | Fluid / TimeStep | User selects a consumption on the chart. |
All events are stored with the _aggregated_ flag to false to allow the identification of new events.
## Usage events aggregator service
## Functionalities
The service will retrieve all new events by filter on the _aggregated_ flag to **false** and the event date before than today.
For each aggregator type we will defined the right calculation to apply to create the appropriate indicator:
- calculation of the session time indicator based on ConnectionEvent
- calculation of the konnectors connected per day based on the fluidStatus
- calculates if a user launched a duel just after earned 15 stars
- calculation of the period between 2 different challenges based on the ChallengeLaunchEvent
- calculation of the period between the first connection and the first challenge based on ChallengeLaunchEvent and ConnectionEvent
- calculation of an indicator based on a single event
- calculation of an aggregated indicator to sum an event type per days.
Once the indicators is calculated we will:
1. post the indicator to the remote doctype
2. push the event used to calculate the indicator to a array, which will be used to identify all events taken into account during the process.
At the end of the service, the service will change the _aggregated_ flag to **true** for all events present in the array.
More technical information are available [here](/ecolyo/technical/services/aggregator_usage_events/)
## Remote doctype
All indicator are post to a remote doctype, which will allow the application to read a defined external API. This doctype is created by Cozy itself.
Here are the actual structure of this remote doctype:
```ts
{
source: string
name: string
startDate: string
endDate: string
value?: number
groups: { [key: string]: string }
}
```
with:
- source: contains "ecolyo" value.
- name: contains the indicator type
- startDate and endDate: used to defined a period or if not relevant, it contains both the date of the events.
- value: contains aggregated value (example: number of page viewed on a day).
- groups: contains all other attribute useful for the indicator (example: context, target, result)
# Definition of the service
The service will run each day at [TO BE DEFINED], as defined in the manifest:
The service will run each day randomly before 7am, as defined in the manifest:
```json
"aggregatorUsageEvents": {
"type": "node",
"file": "services/aggregatorUsageEvents/ecolyo.js",
"trigger": "[TO BE DEFINED]"
"trigger": "@daily before 7am"
}
```
......@@ -16,16 +16,6 @@ The service is responsible of :
1. Collecting all new events from the ``com.grandlyon.ecolyo.usageevents``
2. Aggregated them to indicators
3. Send indicators to the remote doctype
3. Send indicators to DACC with the remote doctype
## To do
As the remote doctype is not yet available for the service here are the remaining task to do:
- In the manifest.webapp:
- Declare the remote doctype [see here](/ecolyo/technical/remote_doctypes/)
- Define the cron to run every day: to check with cozy to ensure that all instances will not trigger the service at the same time
- Create the translation for "fr" and "en"
- In the service:
- Update the remote doctype name in the sendIndicator method
- Add a check on the environment to ensure that the service will not post information on the remote doctype when its comes for alpha instance
More details on the [DACC page](/ecolyo/functionalities/dacc/)
......@@ -96,7 +96,6 @@ nav:
- Profile Type: ecolyo/functionalities/profile_type.md
- PWA: ecolyo/functionalities/pwa.md
- Terms: ecolyo/functionalities/terms.md
- Usage events tracking: ecolyo/functionalities/usage_events_tracking.md
- Ecolyo-Agent:
- Introduction: ecolyo-agent/index.md
- Technical:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment