Daniel-KM / Omeka-plugin-Stats

Plugin for Omeka that counts views of pages in order to know the least popular record and the most viewed pages. It provides useful infos on visitors too (language, referrer...). So this is an analytics tool like Piwik, Google Analytics and other hundreds of such web loggers, but integrated and adapted.
10 stars 2 forks source link
omeka omeka-plugin

Stats (plugin for Omeka)

Stats is a plugin for Omeka that counts views of pages in order to know the least popular record and the most viewed pages. It provides useful infos on visitors too (language, referrer...). So this is an analytics tool like Piwik (open source), Google Analytics (proprietary, no privacy) and other hundreds of such web loggers.

It has some advantages over them:

On the other hand, some advanced features are not implemented, especially a detailled board with advanced filters. Nevertheless, logs and data can be exported via mysql to a spreadsheet like LibreOffice or another specialized statistic tool, where any stats can be calculated.

Installation

Uncompress files and rename plugin folder "Stats".

Then install it like any other Omeka plugin and follow the config instructions.

To count direct download of files, you need to add a line in the beginning off .htaccess:

RewriteEngine on
RewriteRule ^files/original/(.*)$ http://www.example.com/download/files/original/$1 [NC,L]

You can adapt routes.ini as you wish too.

If you use the anti-hotlinking feature of Archive Repertory to avoid bandwidth theft, you should keep its rule. Stats for direct downloads of files will be automatically added.

You can count fullsize files too, but this is not recommended, because in the majority of themes, hits may increase even when a simple page is opened.

Browse Stats

A summary of stats is displayed at /stats/summary.

Lists of stats by page, by record or by field are available too. They can be ordered and filtered by anonymous / identified users, record types, etc.

These pages can be made available to authorized users only or to all public.

For plugins makers, panels can be added via the hook stats_summary.

Displaying some stats in the theme

Stats of a page or record can be displayed on any page via three mechanisms.

An option allows to append the stats automatically on some records show and browse pages via the hooks:

fire_plugin_hook('public_items_show', array('view' => $this, 'item' => $item));

Helpers can be used for more flexibility:

echo $this->stats()->position_record($record);
echo $this->stats()->text_page(current_url());

Shortcodes are supported (Omeka 2.2 or above). Some illustrative examples:

[stats_total]
[stats_total url="/"]
[stats_total record_type="Item"]
[stats_total record_type="Item" record_id=1]
[stats_position]
[stats_position url="/items/search"]
[stats_position record_type="Collection" record_id=1]
[stats_vieweds]
[stats_vieweds type="none"]
[stats_vieweds order="last" type="Item"]
[stats_vieweds order="most" type="download" number=1]

All arguments are optional. Arguments are:

The hook and the helper return the partial from the theme.

stats_total and stats_position return a simple number, surrounded by a span tag when shortcode is used. stats_vieweds returns an html string that can be themed.

Notes

Warning

Use it at your own risk.

It’s always recommended to backup your files and your databases and to check your archives regularly so you can roll back if needed.

Troubleshooting

See online issues on the plugin issues page on GitHub.

License

This plugin is published under the CeCILL v2.1 licence, compatible with GNU/GPL and approved by FSF and OSI.

In consideration of access to the source code and the rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors only have limited liability.

In this respect, the risks associated with loading, using, modifying and/or developing or reproducing the software by the user are brought to the user's attention, given its Free Software status, which may make it complicated to use, with the result that its use is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the suitability of the software as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions of security. This Agreement may be freely reproduced and published, provided it is not altered, and that no provisions are either added or removed herefrom.

Contact

Current maintainers:

Copyright