Page view and download statistics in CKAN

Portal owners who need to show which datasets are used need to know what CKAN's tracking extension records, how to enable and export it, and where it differs from web analytics. This page explains each step and the limits to confirm.

On this page

How page view and download statistics in CKAN answer the usage question

The CKAN tracking extension records dataset views and resource downloads inside your own portal, so a portal owner can report how much each dataset is used without depending on an outside service. A board, a funder or an open data office usually asks a narrow question: how many times was this dataset opened, and how many times was this file downloaded? Teams need the extension when that count is part of a reporting obligation, a grant condition or a decision about which datasets to maintain, improve or retire. Plan for it before the first report is due, because the counts only begin once tracking is switched on.

Keep the extension separate from web analytics tools that measure visitors and sessions across the whole website. Those tools typically rely on a script that runs in the visitor's browser, so their figures can be reduced by blocked scripts and browser settings. The tracking extension reports the view and download events that CKAN itself handles for datasets and resources, so its numbers answer a question about the catalog. Many teams use both: web analytics for site health and outreach, and the extension for dataset-level counts that go into formal reports.

Before you publish any figure, confirm three things against the CKAN 2.11 documentation for the tracking extension and against your own environment. First, how the job that aggregates raw events into summary counts is scheduled and who monitors it. Second, which events count as a view or a download, and how automated crawler traffic is handled. Third, whether the export output contains the fields your funder or open data office expects. Ask any partner quoting this work to state which of these checks are in scope and who runs the update and export jobs after handover.

Configuration options and when each fits

This table compares the main choices for CKAN usage statistics: the tracking extension alone or with web analytics, counts kept in the portal database or exported on a schedule, and public or restricted access to exported figures. Read each row for the situation it suits and the operator effort it adds. Confirm every setting name in the tracking extension configuration keys before you apply a choice.

OptionWhen it fitsOperator effort
Tracking extension alonePortal managers need in-CKAN counts of dataset views and downloads and have no web analytics platformEnable the extension, confirm the statistics update job runs, and check counts after each CKAN upgrade
Tracking extension with web analyticsTeams need visitor, referral or traffic-source data that CKAN does not record, and accept a second tool to configureSet up and maintain the analytics tag, reconcile differing counts, and review privacy settings for both systems
Counts stored in the portal databaseA small team wants one place to read counts and can run the update command by hand or on a simple scheduleLow setup, but the database grows and someone must run the update and check it finished
Scheduled export of countsReports go to funders, boards or open data reviews on a fixed cadence and the export is kept as a dated recordWrite and schedule the export job, store each file, and check that the export ran and is complete
Public access to exported statisticsThe portal publishes usage figures openly to show how datasets are usedReview what the export contains first, since it may expose dataset names and counts that you have not yet checked
Restricted access to exported statisticsCounts include detail tied to named accounts or are shared only with internal staff or a partnerManage file permissions and sharing, and document who may request and receive the files
Dated retention of exportsAn audit or funding review needs a record of what the counts were on a given dateKeep storage and a retention rule, and label each file with the date and the CKAN version in use

Enabling tracking in a CKAN 2.11 portal

This sequence turns on the tracking extension so the portal records page views and downloads in its own database. Each step ends with a check that confirms the previous change took effect before you move on.

  1. Confirm the CKAN 2.11 runtime

    The portal administrator confirms the installed CKAN version and the runtime beneath it before changing anything. Source installs need Python 3.10 or newer and PostgreSQL 12 or newer, and Solr 9 is recommended, as listed in the install-from-source guide. Check the version from the CKAN virtual environment, and confirm the Python and PostgreSQL versions match the requirements. Record the result so that a later failure can be traced to a known starting state.

  2. Install the tracking extension package

    Install the tracking extension into the same Python virtual environment that runs CKAN, using the release that matches your CKAN 2.11 patch level. Installing into a system Python or a different environment is a common cause of the plugin not loading later. Confirm the package appears in the environment's package list with a version number. Confirm the exact package name and compatibility against the extension's own repository before installing, since this page does not list its release numbers.

  3. Add tracking to the plugin list

    Edit the CKAN configuration file, usually ckan.ini, and add tracking to the ckan.plugins line. Keep every plugin already listed, including the DataStore and any theme or harvest plugins, and separate entries with spaces. Save the file and keep a copy of the previous version for rollback. The check is that the file lists tracking exactly once and that the configuration still parses when CKAN reads it in the next step.

  4. Run the tracking database migration

    Run the extension's database initialization command against the same configuration file so the tracking tables are created in the CKAN main database. Run it as the CKAN system user, from the CKAN virtual environment, so file and database permissions match the running portal. Confirm the exact command name in the extension's documentation for your release. The check is a success message from the command, plus a query on the database showing the new tracking tables. Do not continue if the migration reports errors.

  5. Restart the web workers

    Restart the web application server, such as uWSGI behind Nginx, so the running processes load the updated plugin list and the new tables. Restart background workers too if your deployment runs them from the same configuration. Watch the application log during startup for plugin import errors or database errors. The check is that the portal's front page and a dataset page both load without error after the restart.

  6. Set up the scheduled statistics update

    Schedule the extension's update command to run regularly, for example with a cron entry or a systemd timer, under the CKAN system user and against the same configuration file. The update job processes recorded activity into the statistics that the portal reports, so raw views do not appear in reports until it runs. Choose the interval with the portal's reporting needs in mind, and confirm the recommended schedule in the extension documentation. The check is that the job appears in the scheduler and writes a log entry on its first run.

  7. Confirm counts change after the update

    Record the current view count for a test dataset, open that dataset in a browser, and then run the update command manually. Compare the count after the update with the baseline, and confirm that the change matches the number of views you made. For example, if you viewed the dataset twice, the count should rise by about that amount, although bot traffic and repeat visits may change the result. If the count does not change, check the extension's log output, the configuration file path used by the scheduled job, and that the tracking tables contain new rows.

Updating and exporting statistics by audience

The portal operator owns the statistics job and the environment it runs in. Counts only move when the update task runs where the tracking extension is configured, so the operator decides the schedule, confirms each run completes and keeps the database healthy enough to handle the work.

  • Update command: Run the tracking update command documented for the CKAN 2.11 tracking extension from the same environment as your CKAN configuration, so it reads the correct database and settings. Confirm the exact command name in the extension documentation before you write a runbook.
  • Scheduling: Schedule the update with cron, a systemd timer or your container scheduler, and record the interval in your operations notes. Match the interval to how often your reporting periods close.
  • Failure visibility: Capture exit codes and logs from every run, and alert when the job stops. A silent failure leaves totals stale without anyone noticing.
  • Database load: Ask your database administrator how large the tracking tables grow and whether the update should run in an off-peak window.
  • Backups: Include the tracking tables in your database backup plan so historical counts survive a restore.

Check that the most recent run completed successfully before any export leaves the team.

Privacy and access risks in usage data

Usage counts look harmless because they are only numbers, but the raw visit records, the exports built from them and the datasets they describe can all carry privacy and access consequences. The cards below cover the decisions that sit between enabling the tracking extension and sharing its output. Confirm each one with your privacy lead before the statistics reach a wider audience.

Visitor data may be personal data

Page view records can include IP addresses, timestamps, page paths and user identifiers, depending on how the portal and its server logs are configured. Whether that data counts as personal data depends on your privacy notice and the jurisdictions you serve, so do not assume it is anonymous. Ask your privacy lead whether the tracking purpose is listed in the notice and whether the stored fields match what the notice describes.

Who can read raw counts

Raw tracking tables and the statistics pages built on them may be visible to any sysadmin, and possibly to organization editors, depending on your deployment. Confirm which roles can open the statistics views, run the update and export commands, and read the database directly. Limit access to the smallest group that needs it, and record who holds it.

Exported files outlive the portal

A CSV or JSON export of dataset views and downloads is a copy that leaves the system once it is emailed, saved to a shared drive or attached to a report. Set a rule for where exports are stored, who may download them and when they are deleted. Treat exports as sensitive until your review shows otherwise.

Retention of tracking records

Tracking data grows with every visit and stays until someone removes it, so the retention period is a policy decision and not a default you can rely on. Decide how long raw records are kept, how long aggregated counts are kept, and who signs off the deletion. Check whether backups of the database hold the same records and for how long.

Private datasets and counted use

Private datasets and their resources can still generate usage records when authorized users view or download them, which can reveal that a restricted dataset exists and who is interested in it. Confirm how the extension treats private and draft datasets before publishing any totals. Exclude restricted datasets from public reports unless your access rules allow their disclosure.

How a view or download becomes a reported count

The flow starts when a visitor's browser requests a dataset page or resource download from the CKAN web application. The tracking extension records that event inside the portal, which is the trust boundary: nothing outside that line writes to the stored counts. A scheduled update job then processes the recorded activity into current totals, and the export is what an analyst or a web analytics comparison reads. Check that the update job runs on schedule, because reported counts are only as current as its last run.

Visitor requests flow through the portal, where counts are recorded, updated and exported.

Questions teams ask before enabling CKAN usage statistics

How much effort does enabling and maintaining CKAN usage statistics take?

Enabling the tracking extension is a small configuration and deployment task, but the ongoing effort depends on how many sites, dataset types and reporting consumers the portal has. The recurring work is regular statistics updates, checking that the scheduled job runs, reviewing exports before they reach reports, and retesting after each CKAN upgrade. Ask any partner to split the quote into one-time setup and recurring operations, and to state which CKAN minor and patch versions the work targets. Your own team should expect the recurring work to outlast the initial configuration.

What drives the setup time for CKAN statistics tracking?

The current state of the portal matters more than the extension itself. Setup moves faster when the portal runs a current supported CKAN release, has a known deployment method and has a documented way to run scheduled commands. It slows down when the portal is several versions behind, runs with customized templates that need testing, uses a non-standard deployment, or has no staging copy to test against. Ask for a written assessment of these points before agreeing on a timeline. Any duration you are given should be tied to a specific scope and environment.

What access does the internal team need to provide?

A partner needs enough access to change configuration, run the statistics update commands and read the database tables the tracking data is stored in. In practice this means a non-production environment, a deployment pipeline or host access for the CKAN application servers, read access to the database, and a way to schedule recurring commands. Access should be limited to what the work requires and recorded in the engagement scope. Confirm with your security team how access is granted, how it is revoked at handover and whether production credentials may be used outside the change window.

Can an in-house team enable CKAN statistics without outside help?

Yes, a team that already runs CKAN in production can usually enable the tracking extension on its own, provided it has someone who understands the deployment, the database and the CKAN plugin configuration. The harder part is making the statistics trustworthy and repeatable: deciding what counts as a view or download, validating results against web analytics, documenting the update schedule and handling upgrades. Teams new to CKAN operations often find it useful to have a partner review the configuration and runbook once, then keep the process in-house. Check the official CKAN documentation for the extension version that matches your release.

How is a fixed-scope CKAN statistics engagement defined?

A fixed-scope engagement starts with a written description of the portal, the target CKAN version, the environments in scope, the deliverables and the acceptance checks. Typical deliverables include the enabled extension configuration, a tested update and export procedure, a runbook for your operators and a short handover session. Items that are out of scope, such as unrelated upgrades, custom reports or changes to analytics platforms, should be listed explicitly. Ask for the quote to follow from that written scope, and agree in advance how changes will be priced if the portal turns out to differ from the assessment.

What does CKAN statistics count compared with web analytics?

CKAN's tracking extension records activity inside the portal, such as dataset page views and resource downloads, and it stores those counts in CKAN's own database. Web analytics tools usually see page requests across the whole site, including traffic that CKAN may not classify as a dataset view, and they often rely on browser-side scripts that some visitors block. The two numbers will rarely match. Before publishing figures, decide which measure answers your question, document the difference for report readers and confirm the exact counting rules for your CKAN version in the extension documentation.

What operational risks should we plan for after enabling statistics?

The main risks are stale figures, growing database tables, exported data that exposes more than intended and breakage during upgrades. Stale figures appear when the scheduled update stops and nobody notices. Storage growth should be checked against your database sizing. Exports should be reviewed so they do not include user-identifying detail beyond what your policy allows. Each CKAN upgrade should include a test of the tracking extension on staging before production. Assign a named owner for these checks and include them in your operations calendar from the start.

How DeployOpen scopes usage tracking for CKAN portals

DeployOpen scopes usage tracking as a written engagement before any change is made to a portal. The first step is a review of the portal's CKAN version, deployment layout and extension list, because the tracking work depends on which release is running and how it is hosted. The review also confirms whether the site is a single CKAN instance or several, whether it runs in containers or from a source install, and where the database and web workers sit. Our scope document records the version, the hosting model and the people who will approve changes, so the reader can see exactly what is covered before work starts. Any gap found here, such as an unsupported patch level, is listed as a separate item with its own decision.

The second step agrees the reporting questions with the client. Typical questions are which datasets get the most views, which resources get downloaded, and whether reporting must separate public traffic from internal staff use. The answers determine the tracking configuration, the export format and the retention period for the data. The scope also names who receives each report and how often it is produced. Enabling the tracking extension, updating the statistics on a schedule and exporting results are then built and verified in the client's own infrastructure, with the verification steps written into the handover. Confirm with your team which reports you need before the scope is signed, since changing questions later usually changes the work.

The last step is documentation and support. DeployOpen writes the update and export routine as a runbook: the commands, the schedule, the owner of each step, and the checks that show the numbers are current. Upgrades to CKAN and the tracking extension are a recurring cost, so the proposal should show whether they are one-time or covered by a retainer. Retainer support can cover upgrade planning, compatibility checks and retesting the statistics after a release, and the terms are set in the written agreement. Ask for a quote that separates the initial setup, the documentation, and any ongoing retainer, so you can compare it with the effort of keeping the routine in-house.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.