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

Add support for querying Matomo for country data and charts #4

Open
mjordan opened this issue Sep 4, 2020 · 1 comment
Open

Add support for querying Matomo for country data and charts #4

mjordan opened this issue Sep 4, 2020 · 1 comment

Comments

@mjordan
Copy link
Contributor

mjordan commented Sep 4, 2020

I can break these out into separate issues if that's preferable, but I'd like to propose that we add queries that will fetch, for a given URL, country data (that is, country of the client) and Matomo's pregenerated charts.

Here's a sample query that returns country data:

curl -v http://localhost:8000/matomo/index.php?module=API&method=UserCountry.getCountry&idSite=1&period=range&date=2000-01-01,2020-09-02&format=JSON&token_auth=7165b664aadfcf9d95532cb6e0879275&segment=pageUrl==http%3A%2F%2Flocalhost%3A8000%2Fnode%2F10

Here's a sample query that returns a chart, in this case showing the hits during the last 30 days:

curl -v -o chart.png "http://localhost:8000/matomo/index.php?module=API&apiModule=Actions&apiAction=get&method=ImageGraph.get&graphType=evolution&idSite=1&period=day&date=previous30&width=500&height=250&token_auth=7165b664aadfcf9d95532cb6e0879275&segment=pageUrl==http%3A%2F%2Flocalhost%3A8000%2Fnode%2F10"

Here's a sample chart returned by this query:

chart

I am happy to work on this.

@wgilling
Copy link
Contributor

@mjordan, I am also happy to collaborate on this important feature. I think that all of the code handling would be in src/IslandoraMatomoService.php and src/IslandoraMatomoServiceInterface.php.

Should this issue also require a block related to each report type or would these new methods be called from islandora_repository_reports? I could see blocks that have settings that would allow it to be configured to a given country (should this always be the user's current Country?) and optionally filtered by the underlying node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants