« MT4 Podcasting Templates | Main | Convert MT4 Entries to Pages »

Visitor Stats 1.5: Entry Stats, Search Keywords, and More

Visitor Stats is a plugin for Movable Type 4.0 that displays visitor and page view statistics for MT4 blogs. New! Visitor Stats Pro provides even more statistics and widgets (details below).

Visitor Stats looks like this:

New Features in Visitor Stats 1.5

  • Stats Counter widget now includes mini graph
  • Several bugs and warnings fixed.
  • Stats are now reported in the time zone for each blog
  • New template tag for displaying the number of times an entry has been viewed

Announcing Visitor Stats Pro

This is the first release of the "Pro" version of this plugin. Additonal 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)

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

  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. Login to MT and you should be redirected to an "Upgrade" screen that will update your database automatically.
  4. 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.
  5. 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.
  6. Now Publish (rebuild) all your files.
  7. (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: 1704

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..."
  • PHP versions of template tags to support MT's dynamic publishing system.
  • 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 3.6/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 3.6/5 (8 votes cast). Powered by the Ajax Rating plugin.

Comments (31)

By the way, for users of both Visitor Stats Pro and Ajax Ratings Pro, I plan to release a "Most Popular" blog widget. The widget will likely be tabbed, with tabs for "Top Ranked" and "Most Read" entries. This is similar to the widgets that are common on major news media sites.

There is a problem in upgrading this plugin. When I select “Install Templates” from Plugin Settings -> Visitor Stats 1.5, I get this message: “An error occurred
Unknown action install_blog_templates”.

ed Author Profile Page:

One key suggested feature is an Export Tool so stats can be exported for use in reports and analysis. Export to CSV or Excel preferred of course. Is that something on your roadmap?

lexxa, the Template Installer plugin is required to install the templates. I will update the requirements section to reflect this.

ed, thanks for the suggestion. A csv export tool is a good feature idea. I will add that to my list. Note that users of Visitor Stats Pro could probably do this with current version by creating some custom index template that output the stats in CSV format, using the template tags provided.

amir Author Profile Page:

entry stat does not work succesfully because it need rebuild template for change the number of stats.
and entry would has not rebuilded many times after publishing.
see your mt4 test blog.

this entry in index page has 59 views and in the entry link page has 56 views!
http://mt-hacks.com/mt4/2007/06/test_mt4_entry.php

for solving the problem it must load dynamically same as other manually sql ways that loading is done with "echo php" loading from database.

Yes, amir, like all standard Movable Type tags, the stats tags only get updated when the pages are rebuilt. So they will not show absolute "real-time" stats. If and when I create PHP versions of these tags, then you would get real-time stats, but you would have to use MT's dynamic publishing option for all of your pages.

ed:

Thanks Mark. As a marketer, stats are the lifeblood of any online initiative. We need the ability to model and share the data with advertisers and partners to show viability. Let me know if it would be helpful for me to share some of the leading site metrics that are used to measure performance. Perhaps these could be included in a reporting dashboard.

Mark

Thanks for answering our question today. For the communities benefit it was about the following:

When looking at the visitors/view tab, if you click on the bar in the graph, it reveals a text link, but when I click on the text link is returns "unknown action list_view/list_visit error" from the mt.cgi script.

Essentially this is a case of good /creeping featureism/.

Mark said "Those links should not be there, as the functions they point to do not exist. In a future version, I may create functions for those. Note that on the detailed entry stats graphs, those links do in fact work."

Thanks Mark yes they do work on the detailed stat's and we dig it at DCIG

Thanks

Joshua

Here is a comment/feature request.

When viewing the pages in our site, there isn't an option to see the /Page Stats/ I was hoping, long shot, that the entry stat's functionality would roll over to the pages when I look at them in the dashboard.

So, probably easy to do, can you get entry stats to work with Pages as well?

JK

Mark:

Joshua, this works with the current. From you message, I am not sure where you looked or what you tried. But on the "Edit Page" screen in admin UI, the graph (if enabled) should show up and the widget on the right side of the page should be there with a more stats link. If you were referring to your published pages, just add the <:MTEntryStats> tag to your Page template -- it just works.

Please reply with details if this isn't working for you.

CraigV Author Profile Page:

I've tried setting this up, but I get an error message when I put the VisitorStats folder into the \Cgi-bin\Plugins folder... I can't even log into my site - I get an error. If I delete the VisitorStats folder and contents, then it works again... I'm running MT4 under cgiwrap, I've got MySql 4.003. Any suggestions. Thanks.

Only setup items I don't have are:
DBD::Pg (version >= 1.32)

IO::Uncompress::Gunzip
Your server does not have IO::Uncompress::Gunzip installed, or IO::Uncompress::Gunzip requires another module that is not installed. This module is required in order to decompress files in backup/restore operation. Please consult the installation instructions for help in installing IO::Uncompress::Gunzip.

IO::Compress::Gzip
Your server does not have IO::Compress::Gzip installed, or IO::Compress::Gzip requires another module that is not installed. This module is required in order to compress files in backup/restore operation. Please consult the installation instructions for help in installing IO::Compress::Gzip.

Thanks for the detail, CraigV, but you have left out the most important detail: what error message do you get? In addition to the error message in the browser when you try to login, are there any errors in your web server logs? When you remove the VisitorStats folder and then log back in, is there anything in the System Activity log?

Hi Mark

You are right - the pages stat's do work. It was showing something like 65 views for one day which I though meant it wasn't working, i.e. it was showing views for the whole site. So I clicked through to the stats.php (I think that's what shows the ip list etc) and it does have accurate information.

We recently started using feedburner as well, but I noticed a lot of the information on the feedburner site is a bit dated, except for some recent blog posts. Is your product capable of telling us who is accessing the atom.xml files? I tried, but can't find the entry stats for atom.xml or rss.xml - perhaps I'll end up solving my own problem again :-)

Thanks for your quick responses!

Joshua

Okay Mark I think I found a bug in the pages /view stats/ When I am looking at the page-edit, the graph directly above the page edit shows the /view stat's/ for the WHOLE blog. However, when I click through to the /visitor stats/ via the link below the graph - it resets the number of views to those for just that page.

So my confusion was when I looked at the page-edit graph and it shows the views it shows them for the whole blog - on my setup anyway. Any thoughts?

JK

CraigV Author Profile Page:

Mark: sorry about that. I'm not a web guru, but I can usually hobble along if I can find enough posted on the internet. I placed the VisitorStats folder into my www/usr/home/###/public_html/cgi-bin/plugins folder. I also placed the newer PLUGINNETWORK.PL file into the PLUGINNETWORK folder. Am I supposed to put the folder in my domain.com/mt-static/plugins folder? I tried that, but the plugin doesn't appear in my Preferences->Plugins for the blog.

Anyway: here is the browser error which occurs when I try to log into my MT control panel.
---------------------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, ###@pair.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

-------------------
Here is the server error, I think.
-------------------
Nov 6 2007 8:06:21 NICE /usr/bin/perl -w /usr/home/###/public_html/cgi-bin/mt.cgi (perl5.8.8)'/'perl5.8.8 Exception for Movable Type main script

CraigV Author Profile Page:

One last try. I've tried uploading the zip contents two ways.

Using just the VisitorStats folder - this breaks MT4:
-------------------
www/usr/home/###/public_html/cgi-bin/plugins/VisitorStats
-------------------

Using folder structure as unzipped - this doesn't do anything:
-------------------
www/usr/home/###/public_html/cgi-bin/plugins/VisitorStats/VisitorStatsBasic/plugins/VisitorStats
-------------------

Mark:

Great plugin.

Having just installed the pro version, the output on the "most read" widget looks like this:

* The Eyes of Anna (0)
* Box Office Power Rankings: October 26-28, 2007 (0)
* What Would Jesus Read? (1)
* Give Him Your Willie! Errr ... Willies (0)
* A Most Dangerous Word (0)
* Final Thoughts: 31 Flicks That Give You the Willies (0)
* Not One of Us (0)
* Totally Unrelated: Getting Used to It (0)
* None More Black, Turned Up to 11 (0)
* Box Office Power Rankings: October 19-21, 2007 (1)

The obvious problem is that these aren't sorted by rank.

The second problem is that those are simply the 10 most recent entries, rather than the 10 most popular. (Being newly installed, the numbers are obviously low, but there are several entries with at least one view that weren't included in this list.)

Any ideas on how to correct the behavior?

Hi Culture Snob,

A key thing to note, which is also noted in the readme.txt file that comes with the Pro version, is that the tallying of entry views for sorting happens as a "scheduled task", which runs at most once per hour. I seems like in your case, this process hasn't been run yet at all.

MT's scheduled tasks gets triggered under three scenarios: 1) when you receive a junk comment or trackback, 2) When you view an xml "activity feed", or 3) when the /tools/run-periodic-tasks script is run via cron job or via the command line. If you don't regularly use activity feeds, and your sites gets infrequent (or disabled) comments, it is highly recommended that you setup a cron job to execute /tools/run-periodic-tasks at least once per hour. This will also ensure that scheduled (future) entries get published automatically on schedule.

Joshua, you are correct, that is a bug, now fixed in dev. On the "Edit Page" screen, the graph will show the graph for the entire blog. However, if you click "more stats", then you will see the correct graph for that page. Thanks for reporting this.

CraigV, if your mt.cgi file is in:

/usr/home/###/public_html/cgi-bin/mt.cgi

then VisitorStats should look like:

www/usr/home/###/public_html/cgi-bin/plugins/VisitorStats/VisistorStats.pl
www/usr/home/###/public_html/cgi-bin/plugins/VisitorStats/lib/
www/usr/home/###/public_html/cgi-bin/plugins/VisitorStats/tmpl/

... and so on...

I would contact Pair and ask them about the error, I don't see anything here that is specific to this plugin.


Mark:

The readme.txt file? Who has time for reading? (I'm kidding, of course.)

So I ran scheduled tasks and got the following message:

"my" variable $args masks earlier declaration in same scope at /home/jsign/public_html/cgi-bin/mt/plugins/VisitorStats/VisitorStats.pl line 487.

The output is still the same: the 10 most recent entries, without accurate view stats, and not in the proper order.

Culture Snob, that message is a warning, not an error. In other words, that won't cause the scheduled tasks not to run, and ti won't cause any other problems. (That said, I just fixed that in dev, as nobody needs warnings filling up their error logs).

That said, I am not sure what the problem could be here. A few things to check:

-Take a look at the system activity log, are there any message like "Visitor Stats Plugin has tallied entry views (0 seconds)"? That message should get written to the log after it has run.

-While you are on the System Overview page, click "Activity Feed" under Useful Links. (This is my personal favorite way to quickly trigger scheduled tasks). After the feed loads, hit the back button, then refresh the log. Check for any new log messages.

-If you have access to a mysql management tool like phpMYAdmin, take a look at the mt_objectscore table. For most MT4 installs, this table will be empty. But with Visitor Stats Pro you should see some records in here with the "namespace" field set to "views". This table gets populated/updated during the scheduled task. What do you see?

-Finally, and I apologize for the obvious question, but can you confirm that you are using the default widget code? Specifically that the MTEntries tag looks like:

<MTEntries lastn="10" sort_by="score" namespace="views">

Mark,

1) On my activity log is the following error:

"Error during task 'Tally Entry Views': Can't call method "id" on an undefined value at lib/MT/Scorable.pm line 31. 1 hour ago

Error during task 'Tally Entry Views': Can't call method "id" on an undefined value at lib/MT/Scorable.pm line 31.
Visitor Stats Plugin has updated author ids (0 seconds)"

2) I'm not seeing an "activity feed" link on my system overview. There's the activity log, but I think that's different.

3) When I tried to browse "objectscore_namespace," the following was returned:

"MySQL returned an empty result set (i.e. zero rows). (Query took 0.0133 sec)"

4) The widget code reads:

""

Thanks for trouble-shooting this with me.

Does it matter that the individual entries are showing the proper number of page views? Or are the tags reading from different sources?

Mark: On number 4, the code didn't print, but it is the same.

Thanks for the detail. Is there any chance you have deleted the orignal author on your system (author_id = 1). The plugin presumes that an author exists with an id of 1 (perhaps it shouldn't assume this, but for now it does). The error message suggests that MT couldn't find a author with an id of 1....

There is no author_id of 1. I believe the person who designed my site and set me up on Movable Type (more than three years ago) used herself as the first author and deleted herself when she handed it over to me. Too much information, I know, but I guess I'm telling you that it ain't my fault.

Alius Author Profile Page:

Dear Mark,
Hi, I have a problem in installation. When I upload the plugin folder and login on MT it goes to the upgrade database page and then says upgrade complete but when I press to go back to movable type it gets to a circle, meaning it asks me again to login and again do the upgrade.
It continues like this till I delete the Visitorstats plugin folders from my cgi-bin folder.
Can you maybe help me?
thanks

What about a setting that ranks "Most Popular" posts NOT by number of views, but by the number of comments a post has received?

So, probably easy to do, can you get entry stats to work with Pages as well?

There is no author_id of 1. I believe منتديات الوله

دردشة صوتية

الولة

the person who designed

Is your product capable of telling us who is accessing the atom.xml files?

Post a comment