Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Google Analytics Recording

For a number of years now it has been It is possible to record User Interface traffic by enabling the recording of Google Analytics data within DSpace using the jspui.google.analytics.key or xmlui.google.analytics.key in the DSpace configuration file dspace.cfg. Until DSpace version 5.0 only User Interface activity could be recorded, that is to say that downloads initiated straight from a Google search (or any other search engine) were not recorded. As of DSpace version 5.0 downloads are now recorded as Google 'Events', so that all item page views and bitstream downloads are now recorded. 

Google Analytics Reporting

Warning
titleDSpace 7.0 does not yet support

Google Analytics Reporting is not available in DSpace 7.0. It is under discussion as it's unclear how many sites use it. At this time it is tentatively scheduled for discussion as part of 7.2, see DSpace Release 7.0 Status

As of DSpace version 5.0 it has also become possible to expose that recorded Google Analytics data within DSpace. At present this is only available to those sites using themes based on the XMLUI Mirage2 theme but it is hoped that further development will result in it being available for other XMLUI themes and for the JSPUI. The data is retrieved from Google using the Google Analytics Reporting API v3. This feature is disabled by default, to enable it please follow the instructions below. 


Please read the documentation found at  https://developers.google.com/analytics/devguides/reporting/core/v3/  and https://developers.google.com/accounts/docs/OAuth2ServiceAccount. It is the definitive documentation, however, it is over detailed for our purposes so the critical steps are summarised below. The theory is that as a developer you would create a Google project, write your application and store the code in the Google code repository, then create a Google Service Account which your application could use to retrieve data from the Google Analytics API. In our case we already have our application, DSpace, but we still have to go through the motions of creating a project in order to be able to be able to generate the Service Account which we need to allow DSpace to talk to the Google Analytics API.

...

In the [dspace.dir]/config/modules/google-analytics.cfg file review the following fields. These should be either edited directly or overridden in your local.cfg config file (see Configuration Reference).

Property:

google-analytics.application.name

Value:

Dummy Project

Informational Note:

Not sure if this property is required but it was in the example code provided by Google. Please do not delete.

Property:

google-analytics.table.id

Example Value:

ga:12345678

Informational Note:

Logon to the Google Analytics Dashboard and select the Property (or website in plain English) that you wish to target. Then select the Admin section for the property. You should then be able to select the 'view settings' for the view you are interested in. The View ID should replace 12345678 below (note - confusingly the Reporting API documentation refers to the View ID as Table ID).

Property:

google-analytics.account.email

Example Value:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com

Informational Note:

The email address automatically generated when you created the Service Account.

Property:

google-analytics.certificate.location

Example Value:

/home/example/dslweb--privatekey.p12

Informational Note:

The certificate file automatically generated when you created the Service Account.

Property:

google-analytics.authorization.admin.usage

Example Value:

true

Informational Note:

Control if the statistics pages should be only shown to authorized users. If enabled, only the administrators for the DSpaceObject will be able to view the statistics. If disabled, anyone with READ permissions on the DSpaceObject will be able to view the statistics.