Analytics and Reports
The Analytics page contains data related to searches performed. This page is accessible for both Admin and Business users.
In 9.2 we are running a separate Analytics Server to display the data in Analytics Page. It is required to run the Analytics Server to view the Analytics and reports associated in the Analytics Section.
Starting Analytics as a Process
Windows
- Go to C:\SearchBloxServer\analytics
- Run cubejs.bat as administrator
Linux
- Go to /opt/searchblox/analytics
- Run the command ./cubejs
NOTE:
You may also start the analytics server in the background by running the following command:
nohup ./cubejs &
- To stop Analytics process, find the process ID of Analytics server using the following command:
ss -nutlp | grep 4000
- Run the following command to terminate the process:
kill -9 <process-id>
To run Analytics as a service read: Installing and Running Analytics as Service
Important Information:
- If you want to access Analytics outside the installed server, please open port 4000. Also please ensure port 4000 is free to run Analytics Server.
- Please note that the steps are the same if the Analytics Server stops running. Please run cubejs.bat in
<SEARCHBLOX INSTALLATION PATH>\analytics
folder path as administrator
Analytics Dashboard
The Analytics section of the Admin page provides a report on the searches made so far in Searchblox across all collections. The report is displayed as a dashboard, which can be exported to a CSV or excel file.
View Analytics
In the Analytics Dashboard you can view the following items:
- Total Queries Count
- Total Clicks Count
- Total Autosuggest Click Count
- Total Zero Queries Click Count
- Total Queries Graph
- Total Clicks Graph
- Top Searches
- Zero Results
- Top Clicks
You can also select the time frame for the reports using the options in the top right corner of the dashboard.
Download Query Logs Report
Using Analytics you can download query logs for
- 7 days
- 30 days
- 60 days
- 90 days
using the option in the top right corner of the dashboard
Configuring Port Number for SearchBlox Analytics
By Default Analytics server runs in port 4000. This port can be changed by making the following changes:
-
Open the file
C:\SearchBloxServer\analytics\.env
or/opt/searchblox/analytics/.env
-
As mentioned earlier by default, the Analytics server will run on port 4000. You can change the port for Analytics if required by adding the below line in the file
C:\SearchBloxServer\analytics\.env
or/opt/searchblox/analytics/.env
PORT=8081
-
Open the file
C:\SearchBloxServer\webapps\searchblox\analytics\index.html
or/opt/searchblox/webapps/searchblox/analytics/index.html
-
Change the port number to custom port as below:
<input type="hidden" value="8081" id="connection_port">
Configuring SSL for SearchBlox Analytics
When SearchBlox runs on TLS/SSL, we need to place SSL files(cert.pem and key.pem) into C:\SearchBloxServer\analytics
to run SearchBlox Analytics.
Prerequisite:
If you have enabled SSL through DNS then please ensure that SSL is enabled in SearchBlox using the steps provided in Steps to Enable SSL. Only if SSL is enabled in SearchBlox, Analytics will run with SSL.
Follow the steps below to enable secure connection for Analytics:
-
Stop SearchBlox
-
Open the file
C:\SearchBloxServer\analytics\.env
or/opt/searchblox/analytics/.env
-
Add the following commands to enable SSL for Analytics
CUBEJS_ENABLE_TLS=true
-
By default secure Analytics server will run on SSL port 4433. You can also change the port for Analytics if required by adding the below line.
TLS_PORT=8444
- Please uncomment the following lines in
C:\SearchBloxServer\analytics\index.js
or/opt/searchblox/analytics/index.js
var tlsOptions = {
key: fs.readFileSync(__dirname + ‘/key.pem’),
cert: fs.readFileSync(__dirname + ‘/cert.pem’),
-
Open the file
C:\SearchBloxServer\webapps\searchblox\analytics\index.html
or/opt/searchblox/webapps/searchblox/analytics/index.html
-
Change the value of secured_connection to TRUE and change the port number to default 4433 or give custom port if required:
<input type="hidden" value="TRUE" id="secured_connection">
<input type="hidden" value="8444" id="connection_port">
-
Stop and Start SearchBlox
-
Stop and Start Analytics
Enable SSL in SearchBlox
If you are directly mapping DNS to IP using DNS Provider, please make sure to enable SSL in SearchBlox for analytics to work. Also please ensure that the secure port is allowed by your DNS Provider.
Updated over 3 years ago