Setting up Google Analytics with Koha
Google Analytics account
1. A Google Analytics account will need to be created.
2. Once this account has been created, log into the Google Analytics account and set up a property. In Google Analytics, properties are where you send data and set up reporting views. To set up a property, go to Admin.
4. Once your property is created, (final step in this process is "Get Tracking ID), you must set up the tracking code to collect data. Creating a property generates a tracking ID, which you'll use in your gtag.js tracking code snippet.
5. The key piece of information that Koha needs is the Tracking ID that Google Analytics will provide. Here is a link to access that Tracking ID.
System Preferences set up
This is the code will need to be added to your system preference : opacuserjs
//Begin Google Analytics script
ga('create', trackID, 'auto');
let trackID = "";
//End Google Analytics script
6. Copy and paste the trackID into the line right above "End Google Analytic script" between the double quotes : let ID = ""
let ID ="6786763"
This will populate the trackID into the code for you!
Below is an example of what this will look like in your Koha Admin System Preference: opacuserJS
Read more by Kelly McElligott