Skip to content
Snippets Groups Projects
Commit f4c2f926 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

feat(matomo): documentation for matomo in ecolyo

parent b61e38b5
No related branches found
No related tags found
1 merge request!13Feat/ecolyo matomo
......@@ -2,7 +2,7 @@
## Install dependencies
pip install -r /requirements/docs.txt
pip install -r ./requirements/docs.txt
## Commands
......@@ -59,6 +59,7 @@ nav:
- Ecogesture: ecolyo/functionalities/ecogesture.md
- Feedback: ecolyo/functionalities/feedback.md
- Initialization: ecolyo/functionalities/initialization.md
- Matomo: ecolyo/functionalities/matomo.md
- Onboarding: ecolyo/functionalities/onboarding.md
- Price Calculation: ecolyo/functionalities/prices_calculation.md
- Profile Type: ecolyo/functionalities/profile_type.md
......
# Matomo
Matomo is implemented on ecolyo to anonymously track user's navigation and their devices so we understand better how our users use the app.
## Hosting
Matomo is hosted on [statweb.com](https://statweb.grandlyon.com/) where two projects are available :
- PROD for live ecolyo apps
!!! Work in progress
Prod is not yet enabled in live Ecolyo apps. More development and privacy adjustments are needed.
- REC for every alpha instance
_For our development, every alpha instance points to the REC project. That way, we work in an environment that is close to our production one._
## Local testing
### Matomo server
Matomo is disabled by default on local development to optimize performances. To develop specific features related to matomo withtout having to deploy to alpha, follow theses instructions.
```bash
cd docker
docker-compose -f docker-compose.matomo.yml up -d
```
Now visit matomo at [localhost://9800/index.php](http://localhost:9800/index.php) and follow the given instructions to setup your matomo.
On step 5, create a super user with the credentials you want, for example
!!! info ""
```
root
Testtest1
```
On step6, enter dummy values and select a time zone.
Once you finish the setup and access the server, you should see a warning telling you that matomo has not been configured with the correct port. To fix this problem follow these instrcutions.
```
docker ps
# copy container id of matomo
docker exec -it [containerID] bash
# Install vi
apt-get update
apt-get install vim
# Edit config.ini.php
vi config/config.ini.php
```
and under "[General]" add the port **9800** to the following line :
```
trusted_hosts[] = "localhost:9800"
```
After reloading, you should be able to login. We need to make one last change for our app to send data to our matomo server.
### Ecoloy app
In the file
src/targets/browser/**index.tsx** at line 66 comment the dev condition that is preventing the tracker from being initialized.
```jsx
if (
window.Piwik
// && !isDev
) {
```
When you navigate inside the Ecolyo app, in the network tab you should see requests to our matomo server 🎉🎉🎉
......@@ -84,6 +84,7 @@ nav:
- Ecogesture: ecolyo/functionalities/ecogesture.md
- Feedback: ecolyo/functionalities/feedback.md
- Initialization: ecolyo/functionalities/initialization.md
- Matomo: ecolyo/functionalities/matomo.md
- Onboarding: ecolyo/functionalities/onboarding.md
- Price Calculation: ecolyo/functionalities/prices_calculation.md
- Profile Type: ecolyo/functionalities/profile_type.md
......
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