Extension:HitCounters (Fork)
Release status: stable |
|
|---|---|
| Implementation | Database, Data extraction, MyWiki |
| Description | Provides a page views functionality |
| Author(s) | Mark A. Hershberger (MarkAHershberger), WikiMANNia (WikiForMen) |
| Compatibility policy | Master maintains backward compatibility. |
| Latest version | 0.7.2 |
| MediaWiki | 1.38+ |
| PHP | 7.3.19+ |
| Database changes | Yes |
| |
| Licence | GNU General Public License 3.0 or later |
| Download | |
| Translate the HitCounters extension if it is available at translatewiki.net | |
| Vagrant role | hitcounters |
| Issues | Open tasks · Report a bug |
The HitCounters extension displays the view count in the page footer and the most viewed pages on a special page called PopularPages. The extension provides page views statistics that were removed in MediaWiki 1.25, which was released in May 2015.
About
[edit source]Benefits
[edit source]This extension provides feedback in the form of audience measurement to editors. Knowing the rough size of one's audience as an editor allows editors to identify and improve popular articles. HitCounters' special page PopularPages also allows editors to focus on improving those articles with the highest traffic and helps readers discover a project's most curated content.
HitCounters extension enables determining the wikiFactor, a rough measure of a wiki website's popularity.
HitCounters extension is minimally intrusive concerning data security and privacy concerns. The extension handles metrics on the server side, so aggregated data stays within the site's security boundary. The extension does not inject JavaScript to be executed by the client and does not ask a client to download additional un-audited code. The extension does not track users who visit a page. As such, there's no need for special handling of "Do Not Track" browser requests or Global Privacy Control settings. It also does not use third-party services and has no dependencies that can cause conflicts. Other extensions can cause problems during a Composer update.
Differences from former core MediaWiki implementation
[edit source]Before MediaWiki 1.25, the page views counting functionality was in core MediaWiki. This extension is based on that same code but was deliberately made lighter to speed up processing time. Many lines of superfluous code were removed. Also, the old MediaWiki core code performed numerous database queries on every page hit; these have all been removed. This change may lead to some inaccuracies in the data.
The core differences that wiki administrators need to know are:
- The hit counts are stored in the cache.
- The visible hit count at the bottom of each page is updated only once daily. (Pages with a hit count of less than 100 are updated once per minute.)
- That hit is ignored if you refresh your browser on a wiki page.
What counts as view?
[edit source]According to tests conducted by several MediaWiki operators, a view is counted if a page is accessed (action=view), as well as action=render and when accessing a page revision.
A view is not counted with the other actions, such as action=raw, action=edit, action=info.
Migration
[edit source]Installation
[edit source]- Download and move the extracted
HitCountersfolder to yourextensions/directory. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'HitCounters' );
- Run the update script which will automatically create the necessary database tables that this extension needs.
- Configure as required.
Done – Navigate to Special:Versionon your wiki to verify that the extension is successfully installed.
Vagrant installation:
- If using Vagrant, install with
vagrant roles enable hitcounters --provision
Configuration
[edit source]LocalSettings.php
[edit source]| Name | Description | Default |
|---|---|---|
| $wgDisableCounters | When set to true, it stops the counting and disables the notice in the pages footer saying as well as the special page "Popular pages".
|
false
|
| $wgEnableCountersAtTheFooter | When set to true, it shows the notice in the pages footer saying This page has been accessed 256 times.. The default setting is hiding this notice.
|
false
|
| $wgHitcounterUpdateFreq | Sets how often page counters should be updated. | 1
|
Preferences
[edit source]This fork offers the user additional custom settings:
| Name | Description | Default |
|---|---|---|
| Exclude your own page views from statistics | When set to true, it excludes user's own page views from counting.
|
false
|
| Show page ID | When set to true, it adds the PageId to the special page "PopularPages".
|
false
|
| Show textlength | When set to true, it adds the TextLength to the special page "PopularPages".
|
false
|
| Number of most viewed pages | When set to greater as 0, it adds most viewed pages to the special page "Statistics".
|
50
|
See also
[edit source]- Extension:Analytics - Gives access to traffic and edit analytics for the entire wiki, as well as for specific categories and pages
- Extension:WSStats - Page statistics and parser functions and Lua modules to display statistical information
- Stable extensions
- Database extensions
- Data extraction extensions
- Personalization extensions
- Extensions supporting Composer
- Extensions which add rights
- AbuseFilter-builder extensions
- AbuseFilter-computeVariable extensions
- AbuseFilter-deprecatedVariables extensions
- AbuseFilter-generateTitleVars extensions
- GetMagicVariableIDs extensions
- LoadExtensionSchemaUpdates extensions
- PageViewUpdates extensions
- ParserFirstCallInit extensions
- ParserGetVariableValueSwitch extensions
- SkinAddFooterLinks extensions
- SpecialStatsAddExtra extensions
- GPL licensed extensions
- Extensions in Wikimedia version control
- All extensions
- Extensions included in BlueSpice
- Extensions included in MyWikis
- Statistics extensions
- Special page extensions
