User:Jeblad/pageview2

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
Status of this gadget is pre-alpha.

Pageview is a gadget to add pageview statistics to the footer of individual pages. The library use the ordinary API for page impressions of individual pages, Wikitech:Analytics/PageviewAPI#Most viewed articles.

There is two pages

Enabling the gadget from a remote site is by adding the following script to your local or global js-page

Please keep the tracking line, it makes it possible to check if this gadget should be made globally available.

// Tracking [[User:Jeblad/pageview]]
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jeblad/pageview2/script.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jeblad/pageview2/style.css&action=raw&ctype=text/css', 'text/css' );

It can be a good idea to add the loader script to a local gadget, thereby making it easy for all users on the project to enable the functionality.

The gadget use the existing Mediawiki:viewcount system message, or tries to use its own messages. Those can be overridden or localized. If they can be used, then additional information will be available, including a hint about how confident we are that a climb or drop is on-going. The messages are

  • Mediawiki:pageview-countThe page is shown {{PLURAL:$1|one time|$1 times}} last 24 hours.
  • Mediawiki:pageview-small-stdevThe page has a small variation in pageviews, only {{PLURAL:$1|one pageview|$1 pageviews}} or {{PLURAL:$2|one percent|$2 %}} of mean.
  • Mediawiki:pageview-normal-stdevThe page has a normal variation in pageviews, about {{PLURAL:$1|one pageview|$1 pageviews}} or {{PLURAL:$2|one percent|$2 %}} of mean.
  • Mediawiki:pageview-large-stdevThe page has a large variation in pageviews, about {{PLURAL:$1|one pageview|$1 pageviews}} or {{PLURAL:$2|one percent|$2 %}} of mean.
  • Mediawiki:pageview-full-climbIt is climbing fast, relative to the variation in pageviews, with {{PLURAL:$1|one percent|$1 %}} change from a mean of {{PLURAL:$2|one pageview|$2 pageviews}} daily over previous {{PLURAL:$3|day|$3 days}}.
  • Mediawiki:pageview-slight-climbIt is climbing slowly, relative to the variation in pageviews, with {{PLURAL:$1|one percent|$1 %}} change from a mean of {{PLURAL:$2|one pageview|$2 pageviews}} daily over previous {{PLURAL:$3|day|$3 days}}.
  • Mediawiki:pageview-steady-stateIt is in a steady state, relative to the variation in pageviews, with {{PLURAL:$1|one percent|$1 %}} change from a mean of {{PLURAL:$2|one pageview|$2 pageviews}} daily over previous {{PLURAL:$3|day|$3 days}}.</code
  • Mediawiki:pageview-slight-dropIt is dropping slowly, relative to the variation in pageviews, with {{PLURAL:$1|one percent|$1 %}} change from a mean of {{PLURAL:$2|one pageview|$2 pageviews}} daily over previous {{PLURAL:$3|day|$3 days}}.
  • Mediawiki:pageview-full-dropIt is dropping fast, relative to the variation in pageviews, with {{PLURAL:$1|one percent|$1 %}} change from a mean of {{PLURAL:$2|one pageview|$2 pageviews}} daily over previous {{PLURAL:$3|day|$3 days}}.
  • Mediawiki:pageview-missing-daysThere {{PLURAL:$1|is|are}} no data for {{PLURAL:$1|one day|$1 days}}, and if {{PLURAL:$1|that day is|those days are}} included the mean would be {{PLURAL:$2|one pageview|$2 pageviews}} daily and standard variation would be {{PLURAL:$3|one pageview|$3 pageviews}}.
  • Mediawiki:pageview-helpMore information at [[m:Special:MyLanguage/Help:Pageviews|help for pageviews]].