There are currently three optional modules in the CSU Central Package that can be enabled in your local package custom.js file.
- sendSMS – adds a send-to option to text the title's call number to a phone number.
- reportProblem – adds a prominent 'report a problem' link to the service container on the full record page.
- multipleAnalytics – adds Google or Matomo Analytics to Primo
To enable an optional module, you must do two things:
1. Load the module
Currently, you custom.js has this line near the top of the file:
var app = angular.module('viewCustom', ['angularLoad']);
The section in brackets is an array. To add the sendSMS
feature, you need to add it to the array, like this:
var app = angular.module('viewCustom', ['sendSms','angularLoad']);
Multiple features can be added in this way, just separate each one by a comma:
var app = angular.module('viewCustom', ['sendSms','reportProblem','multipleAnalytics','angularLoad']);
This loads the modules into your custom.js file. Next, you'll configure them.
2. Configure the module
Each module has configurations that also need to be set, including the property to enable the feature in the interface. Add the corresponding code for each module directly below the code in step 1.
sendSMS
This module only has one property, to enable the module.
app.constant('smsOptions', {
enabled: true
});
reportProblem
Set the to
property to the email address that will receive the problem report. Also enable the module.
app.constant('reportProblem', {
to: 'dwalker@calstate.edu',
enabled: true
});
multipleAnalytics
Set the siteSource
to either ga
for Google Analytics or matomo
for Matomo Analytics.
siteID
should be your Google Analytics tracking code or similar code for Matomo.
siteURL
should be the Google Analytics link or similar link for Matomo.
defaultTitle
should be OneSearch
or similar name for tracking purposes.
app.constant('analyticsOptions', {
enabled: true,
siteSource: 'ga',
siteId: 'UA-12345678-1',
siteUrl: 'https://www.google-analytics.com/analytics.js',
defaultTitle: 'OneSearch'
});