SUNScholar/Google Analytics/5.X

BACK TO GOOGLE ANALYTICS

Step 1 - Internet Firewall Access
The Google Analytics feature in DSpace needs to consult an external database when doing statistical data lookups.

Therefore you MUST ensure that your repository server has unrestricted access via ports 80 and 443 to the following web site: http://www.googleapis.com

Consult with your campus network administrator to ensure that your server has the correct access to the Google API web site.

Step 2 - Enable GA
Edit the following file: nano $HOME//dspace/config/xmlui.xconf Enable the analytics aspect by removing the comments surrounding the definition.

See example below. 

Step 3 - Configure GA
Edit the following file: nano $HOME//dspace/config/modules/google-analytics.cfg Modify as needed.

See example below:
 * 1) -- GOOGLE STATISTICS CONFIGURATIONS#
 * 2) These configs are only used by the Google Statistics feature  #
 * 3) to retrieve and report Google Analytics statistics.           #
 * 4) The Google Statistics feature makes use of the Google Reporting API v3. At the time of writing the instructions for
 * 5) use could be found here https://developers.google.com/analytics/devguides/reporting/core/v3/gdataAuthorization.
 * 6) You need to create a Service Account but the instructions are not that clear so here is my attempt to pick out the
 * 7) relevant bits...
 * 8) 1. Logon to Google with whatever email address you use to access/manage your Google Analytics account.
 * 9) 2. Create a Google Project. This assumes that you are developing some new software and will make use of the
 * 10) Google code repository. This is not the case but you need to create the skeleton project before you can
 * 11) move on to step 3.
 * 12) 3. Enable the Analytics API for the project.
 * 13) 4. Find the 'credentials' link and click on it. The subsequent process will generate the email address and
 * 14) certificate referenced below.
 * 15) 5. Go to your Google Analytics dashboard and create an account for the newly generated email address and give it
 * 16) permission to 'Read and Analyze' at account level.
 * 1) move on to step 3.
 * 2) 3. Enable the Analytics API for the project.
 * 3) 4. Find the 'credentials' link and click on it. The subsequent process will generate the email address and
 * 4) certificate referenced below.
 * 5) 5. Go to your Google Analytics dashboard and create an account for the newly generated email address and give it
 * 6) permission to 'Read and Analyze' at account level.
 * 1) 5. Go to your Google Analytics dashboard and create an account for the newly generated email address and give it
 * 2) permission to 'Read and Analyze' at account level.
 * 1) permission to 'Read and Analyze' at account level.

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

table.id = ga:12345678
 * 1) Each property (or website in plain english) can have a number of views associated with it. Using the Google
 * 2) Analytics dashboard select the property you wish to target and then select the admin section for that property. You
 * 3) should then be able to select the 'view settings' for the view you are interested in. The View ID should replace
 * 4) 12345678 below. Confusingly the Reporting API refers to the View ID as Table ID.

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

certificate.location = /home/dspace/dslweb--privatekey.p12
 * 1) The certificate file automatically generated when you created the Service Account.

authorization.admin.usage = true
 * 1) Control if the statistics pages should be only shown to authorized users. If enabled, only the administrators
 * 2) for the DSpaceObject will be able to view the statistics. If disabled, anyone with READ permissions on the
 * 3) DSpaceObject will be able to view the statistics.

Step 4 - Rebuild DSpace
Click on the link in the heading above.