DataCite Usage Tracker (beta)

The DataCite Usage Tracker (beta) is an easy way to report usage metrics that are compliant with the COUNTER Code of Practice. Instead of implementing your own log processing following the COUNTER Code of Practice, the DataCite Usage Tracker logs usage events, submits them to DataCite, and generates usage reports.

How it works

Processing views and downloads

The DataCite Usage Tracker is based on a custom tracking script that can be included in web pages. When a landing or download page is visited, this tracking script fires an event to the analytics service hosted at DataCite.

Contributing views and downloads

At the end of each month, DataCite processes these events to generate a SUSHI report, which is submitted to the DataCite Usage Reports API.

Consuming views and downloads

When you implement the DataCite Usage Tracker, the resulting usage metrics are exposed through DataCite Commons and our APIs. For more information, see Consuming Views and Downloads.

Setup

Tracking script

The tracking script is publicly available on our GitHub: https://github.com/datacite/datacite-tracker/. The source code is there for privacy checking; details of what is sent are easily visible.

To implement the usage tracker, the script is included on DOI landing pages. For example:

<!-- Track View -->
<script defer data-doi="10.5072/1234"
        data-repoid="example.com"
        data-metric=”view”
        src="https://cdn.jsdelivr.net/npm/@datacite/datacite-tracker"></script>

<!-- Track Download -->
<script defer data-doi="10.5072/1234"
        data-repoid="example.com"
        data-metric="download"
        src="https://cdn.jsdelivr.net/npm/@datacite/datacite-tracker"></script>

The following attributes are configurable:

AttributeDescription
data-repoidRequired. This is the unique identifier for tracking your usage analytics. This will be provided by DataCite; please contact [email protected]
data-metricOptional. Must be “view” or “download”. If not provided, defaults to “view”.
data-doiOptional. The DOI you want to track. The code will scan for the DOI in embedded schema.org or Dublin Core metadata; if this is not available, the DOI must be specified.

👍

Get your data-repoid

If you're interested in using the DataCite Usage Tracker, please contact [email protected] to get your data-repoid.

View tracking guidelines

The script should be embedded on a landing page:

<script defer data-doi="10.70102/mdc.jeopardy"
    data-repoid="demorepo.stage.datacite.org"
    data-metric="view"
    data-endpoint="https://analytics.stage.datacite.org” src="https://cdn.jsdelivr.net/npm/@datacite/datacite-tracker"></script>

View an example: Demo landing page

Download tracking guidelines

The script should be embedded on a confirmation page that confirms the download has completed successfully:

<script defer data-doi="10.70102/mdc.jeopardy"
        data-repoid="demorepo.stage.datacite.org"
        data-metric="download"
        src="https://cdn.jsdelivr.net/npm/@datacite/datacite-tracker"></script>

View an example: Demo download page

Testing

Once the script is installed, events should be tracked on the appropriate page loads: the landing page for views, and the download page for downloads.

To check the script has been installed successfully and DataCite is receiving events, you can query the API to a check endpoint with the data-repoid. This will then return the last event tracked date or a message indicating no events have been recorded.

Example call (can be made in a browser):
https://analytics.stage.datacite.org/api/check/demorepo.stage.datacite.org

📘

Please contact [email protected] with any questions, feedback, or issues you encounter when implementing the usage tracker.