Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update for 7.4

Table of Contents

Google Analytics

...

Support

It is possible to record User Interface traffic by enabling the recording of Google Analytics data within DSpace using the google.analytics.key in the DSpace configuration file dspace.cfg (or local.cfg)..  DSpace supports either Universal Analytics or Google Analytics 4

Enabling Google Analytics

By default, By default this google.analytics.key is empty, which means that Google Analytics is disabled in DSpace.  To   To enable it, simply set the value of google.analytics.key in either your local.cfg or dspace.cfg:

Code Block
# For Universal Analytics (older style Google Analytics)
google.analytics.key = UA-XXXXXX-X

...



# Or, for Google Analytics 4
google.analytics.key = G-XXXXX


Info

When Google Analytics is disabled, you will see 404 responses returned from the REST API whenever the User Interface attempts to access ${dspace.server.url}/api/config/properties/google.analytics.key .  This is expected behavior, as that 404 response is the REST API telling the User Interface that Google Analytics is not configured.  When the UI sees that 404 from the REST API, it disables Google Analytics tracking the UI.

Warning

DSpace 7 does not yet support Google Analytics v4 (which has keys that look like "G-XXXXX").  We are working on adding this support in the near future, see this ticket for details: https://github.com/DSpace/DSpace/issues/8413

...

Configuring Google Analytics

Additional configuration are provided to allow for enhanced Google Analytics support.

Property:

google.analytics.buffer

Example Value:

google.analytics.buffer = 256

Informational Note:

Maximum number of events held in the buffer to send to Google Analytics.  Used in conjunction with "cron" settings below.

Property:

google.analytics.cron

Example Value:

google.analytics.cron = 0 0/5 * * * ?

Informational Note:

REQUIRED if you want to send file download events to Google Analytics (where they will be tracked as Google "events").  This defines the schedule for how frequently events tracked on the backend (like file downloads) will be sent to Google Analytics. Syntax is defined at https://www.quartz-scheduler.org/api/2.3.0/org/quartz/CronTrigger.html  

The above example will run this task every 5 minutes (0 0/5 * * * ?)

For Google Analytics 4, you MUST also add the "api-secret" below to support sending download events.

Property:

google.analytics.api-secret

Example Value:

google.analytics.api-secrte = mysecret

Informational Note:

(Only used for Google Analytics 4) Defines a Measurement Protocol API Secret to be used to track interactions which occur outside of the user's browser.
This is REQUIRED to track downloads of bitstreams. For more details see https://developers.google.com/analytics/devguides/collection/protocol/ga4 


Google Analytics Reports in DSpace UI

Warning
titleDSpace 7 .0 does not yet support

Google Analytics Reporting is not available in DSpace 7.0. While DSpace 7 can capture statistics via Google Analytics (see above), it is not able to display Google Analytics reports like it did in the DSpace User Interface (like was supported in the XMLUI). It is under discussion as it's unclear how many sites used this feature. See DSpace Release 7.0 Status

...