« Fast Search 2.2 - Support for MT 4.1 and New Features | Main | Convert Blog Templates to Global Templates »

Visitor Stats 1.6: Support for MT 4.1 and New Pro Features

Visitor Stats is a plugin for Movable Type 4+ that displays visitor and page view statistics for your MT sites. Visitor Stats Pro provides even more statistics and widgets (details below).

Visitor Stats looks like this:

New Features in Visitor Stats 1.6

  • Support for MT 4.1
  • Some template tags now supported under MT's PHP-dynamic publishing system (<MTVisitorStatsTracker>, <MTVisitorStatsCounter>, <MTEntryStats>, and <MTPageStats>)
  • Option to build dashboard stats via scheduled for better performance (Pro)
  • Code optimized for better overall performance

Visitor Stats Pro

Additional features included with Visitor Stats Pro:

  • Blog Widget for displaying a ranked list of "Most Read Entries"
  • Entry Stats graph that displays entry pages views by date.
  • List of Recent Visitors and Views on the admin Dashboard (including IP address, username, referrer and keywords).
  • Dashboard widgets for displaying top search engine keywords and referrers.
  • Detailed Entry Stats screen with graph, top keywords used to find the entry, and a list with details of each page view for that entry.
  • Many new template tags for displaying stats on the published pages for your blog.
  • See details about Visitor Stats Pro below

Visitor Stats also provides a "stats counter" tag (and widget) that you can place on your site to display your stats. Note: you can visit the MT4 Test Blog to to see some of the Visitor Stats (and Pro) publishing widgets and tags in action.

Visitor and View Stats

Visitor Stats tracks two key statistics for your blog:

  • Visits - A visit represents a real person who visited your blog. Even if the person views 20 pages of your site, it only counts as one visit (per day).
  • Views - Also known as page views, a view represents the viewing of a single web page on your site. If the person views 20 pages, it counts as 20 views. If a person refreshes the same page several times, each time counts a view.

How it Works

Visitor Stats tracks visitor and view information and records that information directly into your Movable Type database. After placing a single template tag in your templates, Visitors Stats will begin recording stats automatically using a combination of JavaScript and PHP (note that you do not need to enable MT's dynamic publishing feature). Then, when you view the admin dashboard for your blog, you will "Visitors" and "Views" tabs on the Blog Stats widget, which will display a graph of your stats (see image above). On the System Overview dashboard, you will see aggregate graphs of your stats for all blogs on the system.

Visitor Stats - Template Tags

Visitor Stats provides 4 template tags:

  • <MTVisitorStatsTracker> - Place this tag before the </head> tag in every template where you want to track stats. Only place one of these per template.
  • <MTVisitorStatsCounter> - This tag will display the total number of visitors or views for your blog, just like a web stats counter. There is one optional argument:
    • type - the type of stats that you want to count, which either be "visit" or "view". The default is "view". Example: <MTVisitorStatsCounter type="visit">
  • New! - <MTEntryStats> - Used within an entry context, this displays the total number of views for that entry.
  • New! - <MTStatsImageURL> - The URL to the small stats image ( that looks like ).There is one optional argument:
    • type - the type of stats that you want to graph, which either be "visit" or "view". The default is "view". Example: <MTStatsImageURL type="visit">

Visitor Stats Pro Features

Visitor Stats Pro includes additional stats and provides ways to view visitor and view stats in more detail, helping you understand the traffic to your sites. Where are readers coming from? What search keywords are they using in search engines to find your site? What entries are they reading? Which entries get the most views? Visitor Stats Pro helps you answer these questions and more.

Display a List of the Most Popular Entries

Visitor Stats Pro includes a widget that you can use to display a ranked list of the "Most Read Entries" in your blog sidebar, showing readers which entries are the most popular. You can also create customized most readlists by category, tag, etc. Examples include "Most Read Entries in this Category", or a "related entries" section that lists that the most read entries with the same tags as the current entry. This is a powerful feature with many possibilities.

Detailed Stats for Each Entry

In the MT4 admin interface, Visitor Stats Pro displays detailed view stats for each entry. On the entry screen, an Entry Views graph can display the traffic history for that entry:

(The graph on the edit entry screen can be hidden with a single click, or disabled in the plugin settings, for those who don't want to the graph to appear on this screen)

On the right side of the Edit Entry screen, the number of views for that entry will be displayed, and you can click the link for Detailed Stats:

The same graph also appears on the Detailed Stats screen for each entry (just click the "More Stats" link from the main entry screen), plus a list of top keywords for that entry, and a detailed list of the pages views for that entry:

As you can see from the image above, in addition to displaying the IP address for each Visitor (just to left of this image), Visitor Stats Pro will also identify visitors and views by registered users on your system. This includes both local MT authenticated users, as well as TypeKey, Vox, Livejournal, or other OpenID users. This provides valuable information about the traffic stats of your signed-in users. You can even filter the list of page views by dragging the sliders on the graph -- just choose a date range, then click the link that appears. The "From" column shows the URL that the visitor came from before arriving on your site.

More Dashboard Stats

Visitor Stats Pro provides even more stats on the MT4 admin dashboard. This includes a summary of recent visitors and views, along with detail about each. This is similar to the "Recent Entries" and "Recent Comments" displayed when you click the respective tab on the Blog Stats widget:

Top Keywords and Referrers Dashboard Widgets

Visitor Stats Pro includes two new widgets that you can optionally display on your admin dashboard. The "Top Keywords" widget will display a list of the top search engine keywords used to find your blog:

And the "Top Referrers" widget will display a list of the top referrer URLs for your visitors, so you can see where your traffic is coming from:

Many Visitor Stats Pro Template Tags

Visitor Stats Pro includes many new template tags that you can use to display your blog stats on your published pages, blog sidebar, etc. In addition to display lists of "most viewed entries" as described above, you can display lists of top keywords, top referrers, recent visitors, and recent page views. If fact there are so many new template tags, that I won't discuss them in detail here -- I will soon post a separate article that describes the tags with some example template code.

Requirements

Installation or Upgrade

Note: If you are upgrading from version 1.5x, you do not need to reinstall the templates, as they have not changed in version 1.6.

  1. Download and extract the zip file, then upload the contents of the 'plugins' directory into the 'plugins' directory of your Movable Type installation (often /cgi-bin/mt/plugins/).
  2. (Pro Version Only) Upload the contents of the 'extlib' directory into the 'extlib' directory of your Movable Type installation (often /cgi-bin/mt/extlib/).
  3. (Pro Version Only) Upload the contents of the 'mt-static' directory into the 'mt-static' directory used by your Movable Type installation.
  4. Login to MT and you should be redirected to an "Upgrade" screen that will update your database automatically.
  5. For each blog that you want to track, go to Preferences > Plugins and then click on "Visitor Stats" and then click on "Settings". Now click the link labeled "Click here to install the Visitor Stats templates". Note: Even if you are upgrading from a previous version, you should re-install the templates.
  6. Now go to Design > Templates and insert the <MTVisitorStatsTracker> tag before the </head> tag for all templates that you want to track. Note that if you are using the new MT4 default templates, then you only have to do this in one place: click on "Template Modules" from the right side of the page and open the "Header" template module and insert the <MTVisitorStatsTracker> before the </head> tag and then save the module. Note: If you are upgrading from a previous version of Visitor Stats, you can skip this step.
  7. Now Publish (rebuild) all your files.
  8. (Optional) Add the <MTVisitorStatsCounter> tag to your templates or use Widget Manger to add the "Visitor Stats Counter" widget to your sidebar. Pro users can add the "Most Read Entries" widget and start using the many new templates tags.

Get Visitor Stats Pro

Commercial License - $97

Non Commercial Use License - $33

Get Visitor Stats

Visitor Stats (Basic Version) is free to members of MT Hacks.

Download Now

Download Now
Downloads: 1942

Potential Future Features

Visitor Stats Pro was a much larger effort than I anticipated. As such, there are still a number of interesting features that may be added in the future. Future features will be determining largely by the requests of Visitor Stats Pro license holders. Here are some of the potential features:

  • Stats on a per author basis. If you have a blog with multiple authors, see which authors are generating the most traffic.
  • Drill-down into statistics. View the traffic history for a single visitor or registered commenter, see how they navigate through your site and which pages they viewed.
  • Geographical stats. See what country, region and city your visitors are coming from.
  • Recommended entries based on common viewing stats. For example "people who read this entry also read these entries..."
  • And more...

As always, suggestions, comments, and questions are appreciated.

A Note on the Small Stats Graphs

The small stats graphs included with this version of Visitor Stats are called Sparklines and were inspired by the SparkStats plugin for Wordpress. The sparkline graphs used by the Visitor Stats plugin are powered by the sparkline web service provided by bitworking.org. The plugin stores a copy of the image on your blog, and updates the image a maximum of once per hour (note that that stats image only updates when the page is published, either manually or automatically when someone posts a comment, etc.). Credit goes to those sites discussed above for their cool work with Sparklines.

Rate this entry:

  • Currently 4.1/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 4.1/5 (18 votes cast). Powered by the Ajax Rating plugin.

Comments (49)

Carlo Author Profile Page:

I have to say you keep making this plugin more amazing with every revision Mark. Best plugin I have seen for MT!
Just one issue I seem to have with 1.6 Pro: When I click on the "more stats" or "X views" in the edit entry page I get a page with a lot of blank space between the text "Visitor Stats" at the top and the graph, as well as another big area of blank space between the graph and the footer.

Carlo Author Profile Page:

One thing I just thought of.. Is there a way to post a list of Most Popular Entries for a selected time period? For example.. I woudln't want stats from the past two years or so to go in there cuase it wouldn't be relative, and maybe be able to choose the list to only include only the last month, week, or days (etc.) of stats to go into the weighting of entries for the list.

dm Author Profile Page:

Getting an error on upgrade:
Can't locate object method "datasource" via package "VisitorStats::View" at lib/MT/Upgrade.pm line 1270.

dm, a few people have reported this problem, but I can't reproduce it on my server. Any details you can provide would help: MT version? previous version of Visitor Stats? etc...

dm Author Profile Page:

MT version 4.1, Visitor Stats 1.5.

dm Author Profile Page:

Reinstalled the 1.6.1 version. Installs now, but now the main dashboard settings doesn't show anything. I'm in the middle of republishing all my files so maybe it'll clear up after this happens.

dm Author Profile Page:

Sorry... wasn't being clear... The dashboard, under blog stats. It shows Entries, Comments in the title bar, but there are no graphs. Which is rather strange. I'll wait a little bit and see if something shows up after the rebuild.

dm, its another bug, this one caused by the fix to the previous one ;)

I am trying to get both the basic and Pro versions to work on both MT4.0 and MT4.1, and with all the combinations involved, a few things didn't get fleshed out in my testing.

Version 1.62 has been released, get it from the same download link above.

(Note: this issue does not apply to the Pro version, so no update is needed if you are running Pro 1.61).

dm Author Profile Page:

Okay... the site rebuilt. Officially, the graphs have disappeared after installing Visitor Stats plugin 1.61.

dm Author Profile Page:

Ahh... oops. :) Didn't see that you released a new version. Onto another re-installing! lol. Thanks for being quick on the bug fixes, Mark!

dm Author Profile Page:

Sweet. works now! Thanks! If you ever need someone to beta test your things, let me know. :)

I seem to break a lot of it. lol.

Carlo Author Profile Page:

The way I see it dm better you break it now than 100 people later and all of them having to update the fixes ;)

Mark, in the screenshot above for the Blog Stats widget, there's a blue link below the widget stating how many visitors/views you received for the given date range. My VisitorStats installation (MT4.1, VS1.6) doesn't show that link. When will you have it enabled? I'd love to see a list of which postings were read on a given day. Thanks!

arsenie Author Profile Page:

When I try to install the templates for a specific blog I get the following error: Loading template 'get_template_installer.tmpl' failed.

I'm using a clean installation of MT 4.1 and the free version of this plugin. Any suggestions on how to correct this?

Thanks in advance!

I'm still having issues with the dashboard and visitor stats. I can get it to load about once out of every ten times, the rest of the time it just gives me a server error 500 and times out.

Any ideas?

Skavoovie Author Profile Page:

Also receiving the "Loading template 'get_template_installer.tmpl' failed." error message during attempted install of the Basic 1.62 version on MT 4.01a.

Haven't located any information regarding this error. Any details available? Thanks!

Skavoovie Author Profile Page:

...finally re-read the installation process. Doh! Missing dependency!

Installed the required Template Installer plugin per the install instructions, and re-installed the VisitorStats plugin and the templates installed without problem...imagine that. :)

I had install probs, but because I run postgresql on that box. Doh!
Anyone get this working with postgres?

sicminded Author Profile Page:

Hi Mark,

I added to the Entry Metadata template module. It shows but always shows the count as 0 only. Am I missing something in the header or anywhere else?

Thanks in advance for any help.

sicminded Author Profile Page:

err.. added MTEntryStats

How about a way to identify people who haven't logged in or registered but who have left a comment and whose details are therefore cookied? Mint's Secret Crush pepper (http://haveamint.com/peppermill/pepper/10/secret_crush/) can do it, although I'm not sure if that's because it's JavaScript-powered/client-side.

koh Author Profile Page:

Hello.
It is worried because I cannot also install it.
The message is 'Failed in loading get_template_installer.tmpl'.
The version is MT-4.1-ja and Visitor Stats 1.6.
Is there a method of settlement?

Mark:

Are you still planning the article for template tags for Visitor Stats Pro?

In the meantime, I'm looking to list the five most-read entries from the past seven days, listed with the number of views from those seven days. What might that look like?

shoggot Author Profile Page:

Hi i cant get this to work. I had to edit the template path in cms.pm to install it on my windows server:
'template_path=C:/inetpub/wwwroot/MT/plugins/VisitorStats/default_templates
But it always says 0 visitors even though i have added the to the header template. The correct tables have been created in my mysql database but what can i do?
Is it supported on windows server with php?
/Hans

Arash:

hello,

1. How can I appoint a begin amount for my Visitor Stats?

(for example my counter start at 10000)

2. How can I change default views from 20 to another value?

3. Why doesn't the work for me?
(doesn't show the picture)

Thank

Arash:

CORRECTION:

3. Why doesn't the StatsImage work for me?
(doesn't show the picture)

Thank

Hmmm....I've upgraded and followed all the instructions, but all the graphs show 0 ever since I upgraded. It's not getting tracked somehow.

Please help! I am using MT 4.1 and Visitor Stats 1.6.

I'm having a similar problem to Darryl's. I installed VS 1.6 and I'm not getting stats on all my blogs. Some give stats and others do not. The VS plugin has never worked properly and I have just inherited the support. I found that the Template Installer plugin was throwing errors and disabled it about a month ago. Since then I reinstalled with the newest Template Installer and then upgraded VS to 1.6. Now the Visitor Stats and Views show up in the Dashboard, but the stats are askew or absent altogether.

I am also having a few issues but I am running 4.2 RC4 so I was going to wait until the first release to make sure. When I upgraded to RC4 my dashboard widgets disappeared. Top Referrers and Top Keywords show up but not visits and views or recent referrers.

Carlo:

Any news on when this plugin will be updated for MT4.2? I had to delete the files because it messed up the installation. Anxious for the update! :D

jed Author Profile Page:

I too am running 4.2 RC4 and was able to briefly see the dashboard widget and then they disappeared after running cron. Can't wait for the new version.

-jarrod

wayneb Author Profile Page:

Wondering if anyone has tried this with 4.21 and whether it breaks the install as others have mentioned above for 4.2? thanks!

es:

I tracked down the compatibility issues with 4.21 and managed to fix few issues:

In MTVisitorStatsTracker tag's output the commenter_id needs to be changed to user_id at least in my case. We don't have any registered commenters. All users are authors due to LDAP integration.

The Blog Stats widget breaks when you have views or visits in database. The Template processing of the main widget container stops when it should include blog_stats_view.tmpl.

I'm trying to fix the templates, but if someone has any info on how to fix this or there's a new version coming out, I would like to know.

JRM Author Profile Page:

I have the Pro Version and for some reason it's just not logging visits. I have the on my pages (placed in the Header Template). I have a Cron job running and the Activity Log reports: Visitor Stats Plugin has tallied entry views (0 seconds) and
Visitor Stats Plugin has updated Dashboard Stats (0 seconds). I've got lots of traffic but no recorded visitors or views since May 2008! What can I be missing? Using MT 4.23.

am also having a few issues but I am running 4.2 RC4 so I was going to wait until the first release to make sure. When I upgraded to RC4 my dashboard widgets disappeared. Top Referrers and Top Keywords show up but not visits and views or recent referrers.

am also having a few issues but I am running 4.2 RC4 so I was going to wait until the first release to make sure. When I upgraded to RC4 my dashboard widgets دردشة صوتية

الولة

شات صوتي
disappeared. Top Referrers and Top Keywords show up but not visits and views or recent referrers.

Su:

[Posted to an old entry earlier by mistake]

Dashboard breakage over here, also.
The blog stats widget is completely useless now, only displaying the Entries and Comments tabs, and nothing below.

I've poked around in the code a little, and the problem appears to be with the Views tab. I haven't worked out why yet, but if you want your blog stats widget back, and to also get the Visitors tab from this plugin, comment out lines 63-67 in VisitorStats.pl:

# view => { # label => 'Views', # template => 'blog_stats_view.tmpl', # stats => '$VisitorStats::VisitorStats::App::CMS::generate_dashboard_stats_view_tab', # },
Su:

...and the comment form strips PRE tags. You'll have to view source to see what's being indicated there.

Joe:

Hi. I'm running VistorStats Pro 1.67. After upgrading from MT 4.1 to MT 4.261 I'm having the following two problems,

First, when specifing a category with MostReadEntries
I get

Can't use string ("24391") as a HASH ref while "strict refs" in use at (eval 123) line 1.

Second, some of the blogs dashborad widgets display 0 under vistors and views when I have Build Graph Stats via Task set.

Joe:

Sorry, my template tag example got striped from the last post, hopfully this posts ok, the preview seems to actually post too.

This doesn't work
<mt:MostReadEntries category="Photo" limit="10" days="50">

This works fine.
<mt:MostReadEntries period="week" limit="10" days="10">

and the comment form strips PRE tags. You'll have to view source to see what's being indicated there.

http://www.t7b.com/dlil

disappeared. Top Referrers and Top Keywords show up but not visits and views or recent referrers.

http://www.t7b.com/dlil/show80156.html

Erika:

This is a great plug-in! But I think it messed up my existing entries when I decided to turn off the graph dispaly in entries. My custom fields no longer appear and there are blanked out spots in the Display Options list. MT knows it's there because it's trying to publish a field I had deleted in my preferences. New entries are fine, but the existing ones, which are fortunately just mockups and not real content, are useless now for further editing.

Erika:

Hi, my previous problem seems to have disappeared. I'm just having an issue now that is probably common. I found Arvind's tips on solving the problem but it's supposedly caused by dynamic publishing, which I'm not using.

I get this error on certain entry pages: "Smarty error: [in evaluated template line 9]: syntax error: unrecognized tag 'mtmostreadentries' (Smarty_Compiler.class.php, line 580)"

It seems to occur when I individually republish an entry, and on every Quickpost entry. Has anyone encountered this issue and solved it? Thanks.

Erika:

Hi,

I'm still occasionally getting this error. I run a cron job to publish my entries every 15 minutes, and that might have something to do with it:

Fatal error: Smarty error: [in evaluated template line 17]: syntax error: unrecognized tag 'mtmostreadentries' (Smarty_Compiler.class.php, line 580) in /nfs/c05/h01/mnt/70479/domains/projects.davidsuzuki.org/cgi-bin/mt/php/extlib/smarty/libs/Smarty.class.php on line 1095

Also, when I tried to filter by category, it broke completely. How is it done? Thanks.

Hey, Mark.

Any plans to make this work with MT5?


I had a FF comment imported successfully but when I tried to add in the code snippet above to place the FF icon before the author's name, I ended up getting

I had a FF comment imported successfully but when I tried to add in the code snippet above to place the FF icon before the author's name, I ended up getting

Post a comment