Page Counter Module
Page Counter is an EditMe module that provides the following:
- A script that counts each page viewed. This script must be inserted into the HEAD tag of your site's Layout. The other peices of the module won't work until pages are being counted.
- A script that displays the count of the current page.
- A script that displays a report of the 10 most viewed pages.
Installation
The main module file provides three single-click installation options:
1. Installing the Page Counter script adds a tag to the top of your layout's HEAD tag. Page hits will not be counted until this script is installed. Here's what is inserted into your Layout's HEAD tag:
<script language="javascript" editme="parse src"
2.
Installing the Page Count Display adds the following to the bottom of
your site's Menu page content (you can easily edit the words in your
menu page after installation):
Hits: 2141
You can also include this in any other page using [[include:PageCount]]. If you want the count included in your site's Layout instead, you can simply insert <span editme="include 'PageCount'"/> where you want the count shown.
3.
Installing the MostViewedPages link adds the following text linked to
the MostViewedPages report to the bottom of your site's Menu page
content (again, you can easily edit this later):
Top Ten Pages (click to view the report for this site)
NOTE: For performance reasons, the MostViewedPages script is set
to cache itself for 5 minutes. This allows it to be included globally,
such as in the Menu page, without working harder than it needs to. If
you're clicking around your site and expecting this report to be
updated instantly, it won't. Give it a few minutes. You can also do a
hard refresh (Ctl+F5) or empty your browser's cache. Also, the report
only shows pages that are viewable by the current user, so the list may
change based on your login status.
src="/PageCounter?page={page.name}"> </script>
Uninstall
A one-click uninstall is also provided. It will perform the following steps:
Customization
You can follow these steps to change the number of pages displayed in the MostViewedPages script.
- Go to Settings -> Site Management -> Special Pages
- Edit the page named MostViewedPagesScript
- Look for these lines:
// how many pages should be listed?
var howMany = 10; - Change 10 to whatever number you want to display, and save.