Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed setup steps to match current API buttons/links, Added config directions for xmlui.google.analytics.key

...

  1. Enable the Google Analytics XMLUI aspect by editing the configuration file {dspace.dir}/config/xmlui.xconf.
  2. Logon to the Google Developers Console https://console.developers.google.com/project with whatever email address you use to access/manage your existing Google Analytics account(s).
  3. 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.
  4. Enable the Analytics API for the project. In the sidebar on the left, expand APIs & authclick Library. Next, click APIs Analytics API. In the list of APIs, make sure the status is ON for the Analytics On the Analytics API Dashboard, select Enable API.
  5. Create a service account. In the sidebar on the left, select Credentials. Select OAuth / Create new Client IDcredentials, then in the subsequent popup screen , select Service account key. On the next page, click the Service account dropdown and select New service account. Enter an account . This name. Be sure to select the P12 Key type. This will automatically generate the required Service Account email address and certificate.
  6. 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. See *Note below.
  7. Download the P12 key file, and place it somewhere that your DSpace application can access and be referenced as described below in the configuration section. 

...

Configuration settings for Google Analytics Statistics

In the {dspace.dir}/config/dspace.cfg file review the following field to make sure it is uncommented:

Property:

xmlui.google.analytics.key

Value:

UA-12345678-1

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 'Property Settings' for the property (e.g. Test Project) you are interested in. Use the value of Tracking ID. This is not the same as your View Settings View ID (i.e. ga:12345678)

Image Added 

Then this value is the Tracking ID:

Image Added

 

In the {dspace.dir}/config/modules/google-analytics.cfg file review the following fields to make sure they are uncommented: 

Property:

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:

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 (i.e. All Web Site Data) 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). This is not the same as your Property Settings Tracking ID (i.e. UA-112233-6)

Account[Longsight DSpace Clients] -> Property[SUNY Dev] -> View[All Web Site Data] -> View Settings

Image Modified

 

Then this value is the View ID:

Image Modified

 

Property:

account.email

Example Value:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com

Informational Note:

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

Property:

certificate.location

Example Value:

/home/myudspace/var/MYU-abc123.p12

Informational Note:

The certificate file automatically generated when you created the Service Account. The credentials site will generate a JSON file, and then separately you have to download a new P12 file. Copy it somewhere to your DSpace server, and set this property to the path.

Property:

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.

 

Once Google Analytics Statistics is enabled and configured, you can then view reports. An example report looks like:

http://localhost:8080/xmlui/handle/999/1/google-stats

Image Modified