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');
//End Google Analytics script
6. Replace the word <trackID> from the first ga line with the trackID that you received.
For example if your trackID was 6786763
ga('create', '6786763', 'auto');
Below is an example of what this will look like in your Koha Admin System Preference: opacuserJS
Read more by Kelly McElligott