Skip to content

Instantly share code, notes, and snippets.

@seanh
Created January 17, 2013 15:45
Show Gist options
  • Save seanh/4556883 to your computer and use it in GitHub Desktop.
Save seanh/4556883 to your computer and use it in GitHub Desktop.

Setting Up Tracking of Dataset Popularity

The CMAP configuration file and templates are configured so that the popularity of datasets (in terms of number of views) are shown in dataset listings. CKAN's internal tracking of page views is used (and not e.g. the ckanext-googleanalytics extension).

The script update_tracking.sh needs to be run regularly on the server to update the page view statistics. A line can be added to the crontab file on the server to run the script. On an Ubuntu server you can use the command crontab -e to edit your crontab file. Here is an example crontab file with a single cron job that runs the update_tracking.sh script hourly:

# m h  dom mon dow   command
@hourly /bin/sh /usr/local/opendata.cmap.illinois.gov/pyenv/src/cmap-ckan/update_tracking.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment