Skip to content
Ondrej Kosarko edited this page Jun 18, 2024 · 1 revision

Config Google Analytics for Dspace 7.x

Set up Google Analytics

  1. Create Analytics account:

    • Your first step is to set up an Analytics account.
  2. Create a new Google Analytics 4 property.

    • In Admin, look at the Account column to make sure that you've selected the right account. Then, in the Property column, click Create Property then populate information of project

If you are developing in a dev environment, you must populate "www.localhost:4000" for the first field - Website Url and "https://localhost:4000" for the second field - Stream name.

Click Measurement Protocol API secrets to create API Secret Key.

Setup config in IDEA

In file clarin-dspace.cfg we need config 5 properties:

  • rest.properties.exposed
  • google.analytics.key
  • google.analytics.buffer.limit
  • google.analytics.cron
  • google.analytics.api-secret
  1. Property rest.properties.exposed

    Declare property with value "google.analytics.key" so that Front end can get value of property from Back end. Example: rest.properties.exposed= google.analytics.key

  2. Property google.analytics.key

    We can get value of property from field MEASUREMENT ID Example: google.analytics.key=redacted

  3. Property google.analytics.cron

    Define cron for how frequently events tracked in the DSpace backend will be sent to Google Analytics. Keep in mind, changing the schedule requires rebooting your servlet container, e.g. Tomcat. Example: The below example will run this task daily, every 1 minutes google.analytics.cron = 0 0/1 * * * ?

  4. Property google.analytics.buffer.limit

    The max number of events held in the GA buffer (default: 256) Example: google.analytics.buffer.limit=256

  5. Property google.analytics.api-secret

    Defines a Measurement Protocol API Secret to be used to track interactions which occur outside of the user's browser. We can get value of property from Secret value Example: google.analytics.api-secret redacted

Clone this wiki locally