-
Notifications
You must be signed in to change notification settings - Fork 3
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
Collect Statistics from Matomo #1113
Conversation
enum class EventCategory { | ||
Cards | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also change the category. I guess adding Cards
as category is kind of meaningless
|
||
object Matomo { | ||
val logger = LoggerFactory.getLogger(Matomo::class.java) | ||
private const val ACTION_NAME = "Request" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without an action name the request is not displayed properly in matomo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind. I tested this again. Should work fine without the action name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to remove this then?
backend/src/main/kotlin/app/ehrenamtskarte/backend/matomo/Matomo.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some drive-by comments;
I didn't pay attention to what's collected and if we can deduce all desired statistics from that.
backend/src/main/kotlin/app/ehrenamtskarte/backend/config/BackendConfiguration.kt
Show resolved
Hide resolved
backend/src/main/kotlin/app/ehrenamtskarte/backend/matomo/Matomo.kt
Outdated
Show resolved
Hide resolved
backend/src/main/kotlin/app/ehrenamtskarte/backend/matomo/Matomo.kt
Outdated
Show resolved
Hide resolved
backend/src/main/kotlin/app/ehrenamtskarte/backend/matomo/Matomo.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm i can not find matomo credential in passbolt.
Maybe i don't have sufficient rights?
Please provide me access to test :)
On a side note: It might be beneficial to also add a matomo docker container to the dev setup, so we can more easily test the tracking locally. I am not sure how complicated that would be, though. |
Added fancy docker setup for this :) Besides there is a dev site in our live matomo where we can test against the live system.
Don't have the rights to do this @svenseeberg |
6c5f020
to
1297ea6
Compare
docs/development-setup.md
Outdated
14. Set up the matomo instance [http://localhost:5003](http://localhost:5003) (The public version is available at https://matomo-entitlementcard.tuerantuer.org) | ||
15. (optional) Add your matomo config to the backend config | ||
```yaml | ||
matomo: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be added to config-local.yaml?
Even i do that i can not start the backend since
Exception in thread "main" com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "matomo" (class app.ehrenamtskarte.backend.config.BackendConfiguration), not marked as ignorable (7 known properties: "server", "production", "projects", "geocoding", "map", "postgres", "csvWriter"])
Where exactly do i have to add this @sarahsporck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add this to the project config. that's in the config.local.yml e.g.
projects:
- id: nuernberg.sozialpass.app
...
matomo:
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so not in the first level? probably this was my problem. i got an error when i started the backend with this additional parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please update the docs that its easier to know where to add matomo
docs/development-setup.md
Outdated
matomo: | ||
siteId: 1 | ||
url: http://localhost:5003 | ||
accessToken: <matomo-access-token> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can i find the token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visit localhost:5003
and go to the settigns. Either search for "token" or go to "Persönlich->Sicherheit"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had to adjust the config.ini.php
on the docker container to change the trusted hosts and add the port
Not sure if that is just my problem. If not maybe this can be adjusted somehow
[General]
salt = "36941bec3f510a9c9411000c89ee712b"
trusted_hosts[] = "localhost:5003"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarahsporck please add how to findthe matomo-access-token
and update the url
to http://localhost:5003/matomo.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me everything looks fine i just could need some help how to configure matomo locally to proper test this pr. The docker instance and everything works so far :)
And don't we have to put the matomo config for the backend in the config.yml
for the different stages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works fine. just some updates to docs are missing :)
Amazing work!
docs/development-setup.md
Outdated
matomo: | ||
siteId: 1 | ||
url: http://localhost:5003 | ||
accessToken: <matomo-access-token> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarahsporck please add how to findthe matomo-access-token
and update the url
to http://localhost:5003/matomo.php
State<StatefulWidget> createState() => ConfiguredGraphQlProviderState(); | ||
} | ||
|
||
class ConfiguredGraphQlProviderState extends State<ConfiguredGraphQlProvider> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we using this whole thing for? What events/things are we tracking from the frontend? How is the tracking with matomo connected to graphql?
|
||
object Matomo { | ||
val logger = LoggerFactory.getLogger(Matomo::class.java) | ||
private const val ACTION_NAME = "Request" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to remove this then?
import java.io.IOException | ||
import java.util.concurrent.ExecutionException | ||
|
||
object Matomo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: I think in this file there is some duplicated stuff which might be reduced.
@sarahsporck when do you expect to finish/merge this pr? |
In the best szenario I'll finish today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me its fine to merge @sarahsporck
Credentials for matomo can be found in passbolt. For now I tracked:
in each request I tried to include:
Furthermore I decided to implement tracking completely in the backend, as this is where all information is present. This also means we don't have to implement tracking in frontend AND administration.
What's still missing?