Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are currently three optional features 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 featuremodule, 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 feature, you would need to add it to the array, like this:

var app = angular.module('viewCustom', ['sendSms','angularLoad']);

Additional Multiple features can be added as well, separated 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 this code 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'
});