Versions Compared

Key

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

...

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.

 

 

Enable the Google Analytics XMLUI aspect by editing the configuration file dspace/config/xmlui.xconf. 

Logon to the Google Developers Console with whatever email address you use to access/manage your existing Google Analytics account(s) https://console.developers.google.com/project. 

Create a new Google Project. The assumption is that you are developing some new software and will make use of the Google code repository. This is not the case but you need to create the skeleton project before you can proceed to the next step.

...

Go to your Google Analytics dashboard http://www.google.com/analytics/. Create an account for the newly generated Service Account email address and give it permission to 'Read and Analyze' at account level.



# Not sure if this is required but it was in the example code provided by Google.
application.name = Dummy Project

# Each property (or website in plain english) can have a number of views associated with it. Using the Google
# Analytics dashboard select the property you wish to target and then select the admin section for that 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. Confusingly the Reporting API refers to the View ID as Table ID.
table.id = ga:12345678

# The email address automatically generated when you created the Service Account.
account.email = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com

# The certificate file automatically generated when you created the Service Account.
certificate.location = /home/example/dslweb--privatekey.p12

# 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.
authorization.admin.usage = true

...