User:Jeblad/pageview1
- Gadget is discontinued.
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 iare 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/pageview1/script.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jeblad/pageview1/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 its own system messages. Those can be overridden or localized. The messages are
- Mediawiki:pageview-now-single —
The page was only shown {{PLURAL:$1|one time|$1 times}} {{PLURAL:$2|yesterday|$2 days ago}}.
- Mediawiki:pageview-now-multiple —
The page was shown {{PLURAL:$1|one time|$1 times}} {{PLURAL:$2|yesterday|$2 days ago}},
- Mediawiki:pageview-prev-down —
down {{PLURAL:$1|one pageview|$1 pageviews}} from {{PLURAL:$2|the previous day|$2 days earlier}},
- Mediawiki:pageview-prev-same —
same as {{PLURAL:$2|the previous day|$2 days earlier}},
- Mediawiki:pageview-prev-up —
up {{PLURAL:$1|one pageview|$1 pageviews}} from {{PLURAL:$2|the previous day|$2 days earlier}},
- Mediawiki:pageview-mean —
with a mean of {{PLURAL:$1|one pageview|$1 pageviews}} over {{PLURAL:$2|one day|$2 days}}.
- Mediawiki:pageview-incomplete —
The dataset is incomplete.