Download the PHP package daandelange/simplestats without Composer

On this page you can find all versions of the php package daandelange/simplestats. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package simplestats

SimpleStats

Track page views, referrers and devices on your Kirby 5 website. This plugin provides a simple solution for self-hosted, minimal and non-intrusive visitor analytics.

[!NOTE] @bogdancondorachi is doing some awesome modernisations to the k4-and-k5-tested codebase, you can checkout the v1 branch here (alpha).

How it works

Current state

Consider this plugin beta. Any feedback or bug reports are welcome. It's been successfully running on multiple production websites for a few years. The tracking part is almost done and a panel view is available, when the panel interface & sections will be more polished, I'll consider a first release. Please note that the database structure might evolve over time, until a more stable release is available (for which you'll be able upgrade your old databases; the upgrade meccanism already works).

Contributing

I guess a lot of options could be added to suit the plugin for a wider variety of website setups. The panel interface could also be improved and translated. Any contributions (discussions, reports, feedback and pull requests) are welcome, as long as the collected stats stay minimal and reasonably non-intrusive. You may also have a look at the open issues.


Setup

Requirements

[!NOTE] For Kirby 3, I recommend to use version 0.6.x-beta as version 0.7.0-beta introduces Kirby 5 compatibility. It might be Kirby 3 compatible but I'm not supporting it anymore. However, I'm happy to accept retro-compatibility PRs.

Installation

[!IMPORTANT]
After installing the plugin and before starting your webserver, you have to configure the plugin. Whenever you change the tracking resolution (or your website's language setup), start with a fresh database file.

Updating

Before updating, make sure to backup your database file. If something goes wrong, you'll be able to retrieve your stats by replacing the database file later.

Depending on the installation method you used, proceed to the logical steps to update.

After updating:


Configuration

Language setup

Multi-language websites are supported. For each page, there's a global counter, with an optional counter for each language. Warning: Do not add or remove languages to your Kirby installation without resetting your database file ! Also, the panel view has not (yet?) been translated. Note: During the alpha phase, I'm working with a multi-language context. While I try to test single language setups from time to time, SimpleStats might break occasionally in these setups.

Database Configuration

The database file is a simple .sqlite file that holds all tracking data. You can view it from the dedicated panel area, or by including smaller widget sections in the panel page editor. The popular Sqlite format allows you to easily grab the data and visualise it your way, or import it in other software. It's recommended to occasionally backup your stats database file.

Tracking Resolution and Kirby Languages

[!IMPORTANT] Please note that the database is tightly bound to the tracking resolution option (daandelange.simplestats.tracking.timeFrameUtility) and can not be changed afterwards. Changing the resolution while keeping the same database file results in unefined behaviour. If changing, prefer starting with a fresh database. The same goes for Kirby's Language setup: if you change your multilanguage settings, you need to create a new database file (however, manually editing the previous database file, you might be able to preserve your data). This could be automated with update scripts.

Generating Stats

[!TIP] If you'd like to populate the database with some fake stats (useful for testing or developing SimpleStats), you can use the panel interface to generate some in the "Information" tab.

Legal configuration

Depending on your local laws, you might need to sit down and define how personal visitor data is handled.
You might want to inspect the source code to know what's going on in details.
As the license states, there's no guarantee whatsoever.

Config Options

Like any Kirby plugin, many options can be set in your site/config/config.php.
All available options are listed and explained in src/config/options.php.

Example : ``

Here's a list with options that have been tested. (the daandelange.simplestats part has been stripped)
You might also find some more detailed information in the comments of options.php.

Option Type Default Description Comment
TRACKING
tracking.timeFrameUtility String | SimpleStatsTimeFrameUtility 'monthly' Set the trackign resolution class that handles time conversions to periods. (change with caution!) Possible string values: Monthly, Weekly.
tracking.enableReferers Bool true Enables tracking referrers. Gives an insight of who links to your website.
tracking.enableDevices Bool true Enables tracking of minimal hardware configurations (device information)
tracking.enableVisits Bool true Enables tracking page visits (frequentation)
tracking.enableVisitLanguages Bool true Enables a counter per language per page. Only effective in multi-language Kirby installations and enableVisits enabled.
tracking.ignore.roles Array ['admin'] Ignore any tracking for connected users with these roles.
tracking.ignore.pages Array [] Ignore tracking for these page ids. Make sure to use the full id, not the slug.
tracking.ignore.templates Array ['error'] Ignore tracking for pages with these templates. Checked against template() and intendedTemplate()
tracking.ignore.bots Bool false Ignore tracking any bots.
tracking.ignore.botVisits Bool true Ignore counting bot page views.
tracking.ignore.botReferers Bool true Ignore tracking referrers sent by bots.
tracking.salt String 'CHANGEME' A unique hash, used to generate a unique user id from visitor data. Recommended to change, ensures that user identifying information is hard to retrieve if your database leaks.
tracking.anonimizeIpBits Number 1 Anonymise the IP address of X bits. Use 0 for no anonymisation, 4 for full anonymisation.
tracking.method SimplestatsTrackingMode onLoad Tracking mode. See SimplestatsTrackingMode for more information. onLoad is the only fully automatic mode, others need manual attention.
PANEL
panel.dismissDisclaimer Bool false Dismisses the panel disclaimer message.
panel.enable Bool true Enable/Disable viewing stats in the panel.
panel.authorizedRoles Array ['admin'] User roles that are allowed to view statistics from the panel.
panel.breadcrumbLabel String 'SimpleStats' Breadcrumb shown in the panel.
panel.hideBots Bool false To hide bot information from the devices tab.
panel.defaultTimeSpan Integer -1 To set the range (in periods) for the default panel view. Use -1 for viewing the whole available range. Use 4 for 4 weeks or months.

Integrating to your page

Tracking method

If you want to use the default onLoad tracking method, no further action is required, the plugin automatically hooks to Kirby route events.
If you choose any other tracking method, you'll need to integrate the method in your code.

Possible Tracking Methods: (Config value: tracking.method)

  • SimpleStatsTrackingMode::OnLoad : Uses kirby's route hooks to track content when it's served.
    Pros: Ensures that every request is tracked.
    Cons: Slows down the page serve time.
    Setup steps: None.
  • SimpleStatsTrackingMode::OnImage : Generate a simple image tag within your HTML.
    Pros: Doesn't slow down page serve time.
    Cons: You trust the user to load the image.
    Setup steps: You need to call $page->simpleStatsImage() in your template code. You probably want to do this once in site/snippets/footer.php for example.
  • SimpleStatsTrackingMode::Disabled : Disables tracking, no further action is needed. (now much tested yet)
    Setup steps: None.
  • SimpleStatsTrackingMode::Manual : Manually call the tracking function.
    Pros: Very flexible, might solve edge-case-usage.
    Setup steps: You have to call SimpleStats::track() manually. Additionally, you need to populate the http headers argument accordingly to track referers and device information.

Panel Area

The panel area is accessible under this url : /panel/simplestats.
If you're using a custom panel menu, you can add the simplestats area to your menu.

``

Stats blueprint section (optional)

If you wish to display page stats in a section, you may add a pagestats panel section to your page's blueprint.

`


API

Singletons

Page Methods

User Methods

Panel Interface

The panel interface shows your website analytics and tracking setup.

Timeline

The global timeline allows you to select a timespan for displaying analytics.

Charts

Charts are interactive, you can hover them to have details, and click labels to toggle filtering. You can even download timelines as PNGs.

Tables

Tables are interactive and paginated. You can search data within and sort them by clicking on the column headers.


Development

Development was started from a standard Kirby PluginKit, see their plugin guide for more details on using it. These steps are optional, for building development versions.


Powered by

Alternatives / Similar

License


All versions of simplestats with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.1
whichbrowser/parser Version ^2.1
freelancehunt/php-referer-parser Version ^1.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daandelange/simplestats contains the following files

Loading the files please wait ...