Primo analytics
Working with Primo analytics is largely the same as working with Alma analytics. The underlying OAS technology is the same, so the interface is instantly familiar. So, in that regard, we have done all the work necessary to allow us to use Primo analytics. In what will be becoming a familiar refrain, the important idea is that of understanding our data, and the requirements we have for making queries of it.
In this light then, this will be a chapter on developing an analytics reporting dashboard using the Primo analytics subject areas.
Remember to take a look at the "out of the box" analyses provided in "Shared Folders/Primo" and at what other institutions have shared in "Shared Folders/Primo Community".
We shall construct a prompt driven dashboard containing multiple analyses. The parameters input by the dashboard prompt will be for date range to be used throughout the dashboard. Other prompts will be specific to different analyses.
We shall have analyses in 5 of the Primo analytics subject areas:
-
Primo Popular Searches — what is being searched for
-
Primo Zero Result Searches — searches that found nothing
-
Primo Action Usage — what people did with their searches
-
Primo Device Usage — what devices and browsers people were using
-
Primo Sessions — how long people spent with Primo
All important sources of information, that can be used to provide data evidence to improve, add or remove facilities and resources.
The analysis in "Primo Popular Searches" will make use of the capabilities of the Oracle database to use regular expressions, pattern matching for text strings, to select search strings. This technique has not yet been used, i.e. is new material for this chapter.
Primo Popular Searches
This subject area records the search strings used by users in Primo. It can be used to investigate the searches your users are making, when they made them and how many results were returned. The data granularity is by month for popular searches and Ex Libris has rules about the number of popular searches that are stored for each month. Their documentation has further details.
There is a collection of measures for "first page" results which contains an average percentage of results for that service which appeared on the first page. There are first "page results" measures for:
-
Primo, local Primo Records
-
Primo Central
-
EBSCO
-
WorldCat
-
Other
Open up the analysis "primo_popular_searches" from the catalogue folder "/Shared Folders/Primo Community/Reports/Consultants/John Krug" and consider the criteria tab as shown in Figure 1.
We have some selected columns that we wish to see in the analysis results, and we have some filters in place. We have seen these sorts of filters in the "In depth" and "Dashboard" chapters. Considering each one in turn:
-
Filter data by dates in a date range
"Dates"."Month (date)" BETWEEN @{P_StartDate}{timestampadd(SQL_TSI_MONTH, -3, CURRENT_DATE)} AND @{P_EndDate}{CURRENT_DATE}
sqlSo, filter for dates between the variables, "P_StartDate" and "P_EndDate". They may not have been set, so the defaults are having a start date three months ago and an end date of today.
-
Filter searches to only those which have been searched for greater than n times
"Popular Searches"."Searches" >= @{NumSearchResults}{5}
sqlFilter on the measure "Popular Searches"."Searches" to select those that have a number greater than or equal to the variable "NumSearchResults" using a default of 5 if it has not been set.
-
Filter searches to those containing a search string using simple pattern matching
"Popular Searches"."Search String" LIKE '%@{SearchesSearchString}{}%'
sqlFilter by matching the search string against "SearchesSearchString". This is using SQL simple pattern matching, so "% the %" would match any search string containing the word/string " the ". The default is "{}" nothing. So the match would be on "%%" which matches anything.
-
Filter searches to those containing a search string using regular expressions
EVALUATE_PREDICATE( 'regexp_like(%1, ''@{SearchesRegex}{.*}'')', "Popular Searches"."Search String" )
sqlFilter by matching the search string against "SearchesRegex", a regular expression. The default regular expression is ".*" which would match any character 0 or more times, i.e. will match anything.
The OAS function "EVALUATE_PREDICATE" calls its parameters and returns true or false. In this case the parameter is to call the Oracle database function "regexp_like", the regular expression pattern matcher, with the parameters of a regular expression and the data field "Popular Searches"."Search String". The function "regexp_like" returns true or false depending on whether the data matched the regular expression.
Why not just call "regexp_like" directly? You can’t, it’s not available as an OAS function. But, we have the OAS functions "EVALUATE", "EVALUATE_AGGR", and "EVALUATE_PREDICATE" to make an Oracle database function call.
The last two filters will become clearer when we are working with them in the analysis. They are filters working in conjunction with each other using the "AND" clause, so we just need to remember to have one of them set to its default for the other to work as we would like. Doing these two types of string filtering together in a real analysis would not be the greatest of ideas, we are just doing it this way for learning purposes.
The results screen is shown in Figure 2.
Primo Zero Result Searches
These are searches that have returned no results to the user. Analysis of these could be used to improve the user experience. For example, you may have common misspellings that are not caught by your Primo did-you-mean facility. Use of this subject area could help identify those. Or, perhaps there is a consistent use of the wrong scope for a search that might benefit from user interface improvements.
Take a look at "primo_zero_searches". It has been constructed in a very similar fashion to the "Popular Searches" analysis.
Primo Action and Device Usage and Sessions
These three subject areas provide statistics on how Primo is being used at your institution, what devices, operating systems and browsers are being used, what actions are done while using Primo and the number and average duration of Primo sessions. These can all be monitored to understand your user community, and to evaluate and improve the effectiveness of provided services.
These analyses are in "primo_actions", "primo_devices" and "primo_sessions". Take a look at the definition of these analyses. Note how all the analyses use a very similar dates filter to filter on dates between "P_StartDate" and "P_EndDate". When values for these two variables are supplied via a dashboard prompt then all these analyses, on the dashboard, will reflect the same date range.
Using Oracle database functions
We use an OAS function "EVALUATE_PREDICATE" to call an Oracle DB function "REGEXP_LIKE". This may appear a little complicated to start with, but it’s a generalized mechanism whereby OAS users can gain access to some useful functions of the underlying Oracle database. Regular expressions can be thought of as a kind of advanced wild-carding. Much more information on regular expressions is available via your favourite search engine.
There are also OAS function "EVALUATE" and "EVALUATE_AGGR" (evaluate aggregate) which have a similar purpose but return results rather than a boolean, true or false values, as is the case with "EVALUATE_PREDICATE".
In the same folder there is an analysis, "evaluate" which has a couple of examples. There are many aggregate functions available to OAS but "mode" is not one. The mode of a set of numbers is the value which occurs the most. Oracle has a function, "STATS_MODE" to compute this. The Oracle function "regexp_replace" can be used to replace strings that match a regular expression with another string. The "evaluate" analysis has two examples:
-
"evaluate_aggr('stats_mode(%1)', "Popular Searches"."Searches")"
, what was the most common number of times any search was used. -
"evaluate('regexp_replace(%1, ''the'', ''THE'')', "Popular Searches"."Search String")"
, replace the string matching "the" with "THE".
The dashboard "Primo Dashboard"
The dashboard brings together the analyses discussed above and dashboard prompts for date range, search strings, and number of searches. Follow along with the video Exploring a Primo dashboard example.