daandelange / kirby3-simplestats Goto Github PK
View Code? Open in Web Editor NEWAll your data are belong to us. -- Track pageviews, referrers and devices on your Kirby 3 website.
License: MIT License
All your data are belong to us. -- Track pageviews, referrers and devices on your Kirby 3 website.
License: MIT License
I started collecting data with the default monthly view and everything looked fine:
Then I wanted to switch weekly view instead to have a more detailed timeline but this messes up the visualization of the data:
After switching back to monthly everything is back to normal so it seems that the data is stored correctly in the database but the logic to visualize it for the weekly option has an issue with it.
As a dummy protection, db queries are limited to 1000. (could cause issues on ancient databases, or websites with a lot of traffic.)
Figure something out to set/handle this correctly.
This issue lists all reported K4 issues, hoping to bring support for it.
(Please create a new issue to add one)
Can you please add support for composer?
It is offered by nearly all plugins and makes updating them very easy.
Hey there,
I noticed that in your README
you wrote that the fingerprint created with md5( trunc(IP) + trunc(UserAgent) + Salt ),(...) according to GDPR, seems to be considered as personal data
. This could lead to people rather not using it when really your solution is actually privacy-friendly, if I understand your implementation correctly:
Since strings created with md5
cannot be restored, they are unable to identify the person they were created from. A properly truncated IP by itself would make sure that a person could not be identified by this means, and this is even more true for your hashing solution!
jm2c
Cheers,
S1SYPHOS
According to this topic there's a bug when you login as a non-registered user-role in the options.
As a temporary work around, register any custom user role in the simplestats options.
Right now my site sits behind Cloudflare CDN that do page caching which means if you hit the cache you aren't hitting Kirby thus SimpleStats won't register the visit.
It would be very useful have a companion JavaScript file that can talk to SimpleStats and punch through CDN caching.
Link to plugin: https://github.com/Daandelange/kirby3-simplestats
Clicking initially the "Simple Stats" in the left menu, it shows "Information" in the top menu
Clicking "SimpleStats" in the top menu, it changes "Information" to "Page Visits" - but page did not change:
Running Version
Author @zeljkovorel from getkirby/kirby#5571
The data presentation is very "functional" but it could look better.
Specially when data accumulates (over time, many pages, etc.), I guess the presentation gets worse.
Any suggestions / contributions / screenshots are welcome.
Make the monthly precision a parameter, to enable tracking with a weekly precision or any other.
The option authorizedRoles
seems not to work properly. With the option set to admin
for example, SimpleStats is still fully accessible for editor
users. Only the option dismissDisclaimer => true
set in site/config/config.php
is ignored, meaning that the disclaimer dows show for editors.
Expected behavior
For unauthorized roles, SimpleStats should not be visible in the Panel menu.
Plainkit Kirby 3.6.1.1
Console output
code: 403
details: Array []
exception: "Kirby\\Exception\\PermissionException"
file: "api.php"
key: "error.permission"
line: 331
message: "You are not authorised to upgrade the db file."
route: "simplestats/mainview"
status: "error"
<prototype>: Object { … }
index.js:1:6814
code: 403
details: Array []
exception: "Kirby\\Exception\\PermissionException"
file: "api.php"
key: "error.permission"
line: 58
message: "You are not authorised to view statistics."
route: "simplestats/pagestats"
status: "error"
<prototype>: Object { … }
index.js:1:6814
My system
When using SimpleStats together with Pagetable plugin by sylvainjule (https://github.com/sylvainjule/kirby-pagetable), the UI of pagetable gets compromised in the panel.
Kirby 3.6.1.1 Plainkit with SimpleStats and Pagetable:
Without SimpleStats:
My system
For development, it would be very helpful if the localhost
environment was ignored.
For example, via a setting in plugins/simplestats/src/config/options.php
:
tracking => ignore => localhost => true (default)
.
In this context, it would also be useful if certain data could be deleted manually (for example, localhost
).
Now, slugs are used in SimpleStats, Kirby has a new page UID system.
Hello
I would like to help you for the French translation. Can you provide all entries that must be translated plz ?
Bye
First of all, thanks for this great plugin. I think it fits really nicely into the Kirby mindset 👍
I noticed my website did not track any referrers so I had a look at simplestats_errors.txt
and saw hundreds of messages like General error: 1 table referrers has no column named medium
. After editing the SQLite database and adding a medium
column to the database it started working.
You'll probably have to add this to this line.
An export function would be very useful to pass on (selected) statistics to clients or to archive them. For this purpose, it would be practical to define specific time periods for the export.
Processed and visually prepared data as in the panel would be excellent, for example in PDF format. In addition, CSV or Excel output of the raw data.
Kirby\Database\Database::query()
can throw errors : catch them for better error reporting.Hey,
I am not sure if my installation is the problem or I didn't understand the Documentation...
I want to track my blog sites and added the Page method "$page->simpleStatsImage()" to the header of my template so every time the page is called this code will be executed... But my tracking charts are all empty just the list on the information page is filled with 2 entries "Visitors (current session)"
The Setup checker doesn't give any warnings (see SC) - did I need to use the singeltons to? and what is the "OnImage" tracking method? - is there another documentation site for this plugin and I overread it?^^
This is my current Information Page:
And all other pages looks like this (from the avail. data perspektive ^^)
This is my header code (snippet):
<body data-bs-theme="light">
<header>
<?php $page->simpleStatsImage() ?>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
I've tried to use the Singletons too but I only get an error (I don't know what Libary I need to import ^^)
Hope that somebody can help me :)
Dissociated from the content, to have an insight over global language usage.
Currently, the config's tracking period must match the database's one.
Database files aren't exchangeable with different tracking period configurations.
Corruption cases: when the configuration suddenly changes or when databases are manually interchanged with a period config mismatch.
To protect the database data :
daandelange.simplestats.tracking.method
)Tried with starterkit v3.9.8 and v4.0.3
First I tried to set options like indicated in the docs:
// site/config/config.php
return [
'debug' => true,
'daandelange.simplestats.tracking.method' => \daandelange\SimpleStats\SimpleStatsTrackingMode::OnImage,
];
PHP promptly crashed...
I ended up changing the setting directly in src/config/options.php
Then I put <?= $page->simpleStatsImage() ?>
right before the </body>
tag, which generates the following:
<img alt="simplestats counter pixel" class="simplestats-image" height="1" loading="lazy" src="http://localhost:81/starterkit-4.0.3/notes/counter.png" style="position: absolute; right: 0; pointer-events: none; height: 1px; width: 1px; opacity: 0;" width="1">
The src URL is the page URL + /counter.png
However it fails to load and returns 500 error in the dev console, I'm assuming this is not the intended behavior and that tracking failed.
Hi Daandelange, I’m quite interested by your plugin, but I’m a real n00b!
I followed the Installation method (copy to /site/plugins/simplestats
), but now I’m stuck. How do I access the plugin? Do I need to go to my Kirby panel
?
Hi,
got simplestats up and running to some extend, but when I try to implement the statistics in one of my blueprints, it throws this error, when I enter that particular blueprint in the panel
Cannot read properties of undefined (reading 'length')
My Blueprint uses tabs and goes like this:
title: MySite
tabs:
stats:
label: Stats
icon: globe
sections:
pagestats:
type: pagestats
label: TestHeadline
size: small
showTotals: true
showTimeline: true
showLanguages: true
showFullInfo: true
content:
label: Content
icon: text
columns:
- width: 1/3
fields:
titlebar:
label: Website Title
type: text
line1:
type: line
I also enabled the panel view in my config php like this:
require_once(__DIR__ . '/../plugins/simplestats/src/models/SimpleStatsTimeFrameUtility.php');
return [
// [...] your options ...
// Simplestats
'daandelange.simplestats.panel.enable' => true, // Disable the panel view completely
'daandelange.simplestats.tracking.enableReferers' => true, // Disable referer tracking
'daandelange.simplestats.tracking.timeFrameUtility' => new \daandelange\SimpleStats\SimpleStatsTimeFrameUtilityWeekly(), // Here you can put your custom inherited class from SimpleStatsTimeFrameUtility
'daandelange.simplestats.tracking.timeFrameUtility' => 'weekly', // Alternative
'daandelange.simplestats.tracking.method' => \daandelange\SimpleStats\SimpleStatsTrackingMode::OnImage,
];
can somebody give me a hint on what's wrong there?
Currently, only "authorised user roles" can view stats in the panel and there is still some polishing to do.
Plus introducing user-permissions would be useful.
dev=true
?)Dear Daan,
i was very happy to read about your plugin in the last kirby kosmos issue and installed it right away.
Judging from the panel the plugin seems to work there, but there is no .sqlite file being created in the site folder (site/logs/simplestats.sqlite), in fact, no logs folder has been created and the panel view states: "Unable to open database: unable to open database file".
So there seems one part not working as expected.
Do i have to create the folder site/logs and the files there myself or is this automatically done by the plugin?
Is there a way to troubleshoot this?
I am running on kirby 3.4.0
Matthias
Just speaking for myself, but I much prefer the previous chart colors and style - bright, pastel colors with clear differentiation between different items, with the addition of highly visible black outline and clearly denoted data points.
I feel I need to work harder to read the chart in the new version.
I really like this plugin but I am not so much interested in the bots data. Could you add an option in the panel or in the config to toggle bots data in the visualizations?
Writing tests could be very useful to have to ensure production readyness.
Specially on the timeframe utilities which can cause infinite loops if not working correctly.
Also the tracker code kirby integration could be tested.
I have no idea how, but Kirby itself and many plugins use tests, so it should be doable.
Right now, because SimpleStats does not have a 'stable' release tag, when we try to follow the simple installation instructions for composer, the installation fails - because the latest versions of composer assume by default that we always want to install the latest STABLE version of a package. If a package has NO stable version, then installation fails with a warning:
In order to be able to install with composer, at the moment it's necessary to explicitly specify a 'beta' compatibility - e.g.:
composer require daandelange/simplestats:~0.4-beta
It would be nice to have the possibility to edit or remove the breadcrump label via options.
The current output may not be suitable for every context:
SimpleStats - All your data are belong to us !
I get the message "Kirby\Cms\App::page(): Argument #1
($id) must be of type ?string, int given, called in /.../site/plugins/simplestats/src/models/Stats.php on line 938" in backend.
I have some page IDs with numbers only (e.g. "360"), so PHP seems to treat $uid as int in this case. I was able to work around by making sure that $uid is string ($uid = strval($uid);
before line 938). The diagram creation process now works as expected.
I'm running Kirby 4.1.0 on PHP 8.2.15, so I don't know if it's a case for the Kirby 4 incompatibility list or just a PHP issue.
Anyway, thanks for this great plugin!
Hey!
I just installed the plugin to a site I'm currently developing. The SimpleStats page shows up in the Panel, but it is completely empty:
An error appeared for the first time I opened the page, but not any more:
This may be normal as the site is not yet receiving traffic, but even the current sessions section is empty after I visited a few pages:
It's interesting to note how the date range selector defaults to 1999 and if I open the datepicker and press "Today" it doesn't change the date.
I tried to use the Tracking Tester feature to populate the DB with some data, but got the following error:
The .sqlite file is created successfully.
I'm running PHP 8.2.2 (tried 8.1 as well) and Kirby 3.9.1 on a Ubuntu 20.04.5 LTS server above Dokku 0.29.4.
Do you have any idea what can be the problem?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.