Requirements
- Riva Insight On-Premises 2025.2 or later
- Riva Sync On-Premises 2025.2 or later
- Firewall Access to the Riva Insight Server for Riva Sync
- ASP.NET Core Runtime Hosting Bundle
- MongoDB
- MongoDB Shell
- Track State Service Package
- Private and Public Asymmetric JWT keys (from Riva)
Deployment Models
The deployment model you choose is dependent on your current setup for Riva Sync.
- Separate Track State Services for each Insight environment
- Recommended if using multiple sync services/pods
- Requires a sync service/pod corresponding to each Insight environment
- Each Insight/Sync environment will point to their own TSS Service
- More isolation (each can have its own TSS version managed independently)
- Add Service in Insight app folder parent I.e. C:\Riva\Riva Insight\Prod\runtime\TSS
-
Shared Track State Services for all Insight environments
- Recommended if using a single sync service/pod
- Each Insight/Sync environment will point to the same TSS Service
- No isolation (all environments use the same TSS)
Install Prerequisites
Riva Insight On-Premises 2025.2
Riva Insight 2025.2 is required for using the Track State Service
- Ensure Riva Insight is updated before proceeding with the Track State Service
Riva Sync On-Premises 2025.3+
Riva Sync 2025.2 or later is required for using the Track State Service
- Ensure Riva Sync is updated before proceeding with the Track State Service
- Riva Sync will need access to the Riva Insight server (same FQDN/Port used for end-user access)
ASP.NET Core Hosting Bundle
The Track State Service is built on ASP.NET Core 8. The ASP.NET Core Runtime Hosting Bundle is required for the Track State Service to run under the Riva Insight.
- Download the ASP.NET Core Runtime Hosting Bundle
- Ensure the download is unblocked.
- Ensure the download is unblocked.
- Install the ASP.NET Core Runtime Hosting Bundle
- Confirm that this is installed by navigating to the IIS folder located at C:\Program Files (x86)\IIS\ or C:\Program Files\IIS\
MongoDB Setup and Configuration
MongoDB Installation
MongoDB is used to store the Track State Data.
NOTE: The steps below are using MongoDB community version, however the decision on which MongoDB version or MongoDB compatible database to use is up to your organization. MongoDB compatible databases must support MongoDB APIs. TSS has been confirmed for MongoDB and Amazon DocumentDB.
- Download MongoDB Community Version
- Ensure the download is unblocked.
- Install MongoDB
- During installation leave all defaults
- Make sure that MongoDB Compass is also selected
- The setup wizard can take 10 minutes or more to complete
- ‘Finish” the setup wizard and the MongoDB Compass will automatically open. Leave the MongoDB Compass open as it will be used in later steps below
MongoDB Shell Installation
The MongoDB Shell will be used to create the root user.
- Download Mongo DBShell
- Ensure the download is unblocked.
- Extract the files in a new folder (Eg C:\Program Files\Mongo DB Shell)
MongoDB Root User
- Run MongoDB Shell as an Administrator:
- Within the MongoDB folder, navigate to the bin folder.
- From 'bin' folder, right-click on 'mongosh.exe' and select 'run as Administrator'
- Enter 'mongodb://localhost' as the database name (if prompted)
- Type 'use admin' to switch to the admin database
- The prompt should show as
admin>
- The prompt should show as
- Create a root user using the following command:
REPLACE user (pwd) with the user name of your choice, and pwd (mongo) with a secure password.db.createUser({ user: "root", pwd: "mongo", roles: [{ role: "root", // Assign the root role db: "admin" // Assign to the admin database }] })
- Exit the shell by typing 'exit'.
MongoDB Connection
- Open MongoDB Compass
- Click on '+ Add new connection'
- For the connection name, enter
mongodb://root:mongo@localhost:27017/?tls=false- Replace user (root) and password (mongo) with the user name and password you created above
- Select 'Save & Connect'
- The database can now be connected to as
localhost:27017
Private and Public Asymmetric JWT keys
There are a few places in this document that require adding public and/or private asymmetric keys for JWT. Please read below.
- Keys can be requested from Riva
- Insight and Sync require both private and public keys
- TSS only requires the public key
Track State Service Package
- Download the Track State Service Package
- Look for the most recent package (package name starts with TrackStateService.)
- Ensure the download is unblocked.
- Extract the contents of the package.
- Follow the steps below as per your preferred Deployment Model
A: Separate Track State Service for each Insight environment
- Create a new folder under your existing Insight application called TrackStateService
-
default location: {drive}\Riva\Riva Insight\{AppName}\runtime\
-
- Copy the contents of the extracted package into the TrackStateService folder
B: Shared Track State Service for all Insight environments
-
Create a new folder alongside your existing Insight application called TrackStateService
-
default location: {drive}\Riva\Riva Insight\
-
default location: {drive}\Riva\Riva Insight\
-
Move the contents of the extracted package into the TrackStateService folder
Setup Track State Service under IIS
Application Pools
- In IIS, under the current server, right-click on Application Pools and select Add Application Pool
- Create an Application Pool
- For Name, set the App Name and append -TrackStateService to the end.
- Change .NET CLR version to No Managed Code
- Click on OK when done.
Track State Service Subapp:
- In IIS, right-click on your Insight application and select Add Application
- Create the TrackStateService sub-application:
- For Alias, enter TrackStateService
- For Application Pool, select the application pool you created in the previous section.
- For Physical Path, select the location you placed the TrackStateService under in a previous section.
- Make note of the virtual path as it will be needed for the next section.
- In IIS, select the newly created TrackStateService application.
- In the Actions pane on the far right, select Advanced Settings.
- Make note of the Virtual Path
Configure Track State Service
Track State Service Base Url
-
NOTE: The TrackStateURL is the FQDN or Server name of the Riva Insight Server, plus the tss virtual path.
I.E. https://{fqdn}/{tssVirtualPath} || https://my.riva.com/insight/trackstateservice - Make note of the TrackStateURL for future steps.
Track State Service App
NOTE: If using the Shared Track State, configure this to point to the primary Insight application that will be used by Riva Sync.
- In the TrackStateService folder, look for a file called appsettings.json.
- Configure Virtual Subpath
- Add a new entry for VirtualSubPath, replacing the value with the virtual path from the previous section.
- "VirtualSubPath": "/insight/trackstateservice"
- Add a new entry for VirtualSubPath, replacing the value with the virtual path from the previous section.
- Config MongoDB connection
- Search for a section called MongoDb and look for ConnectionString
"MongoDb": { "Client": { "ConnectionString": "mongodb://root:mongo@localhost:27017/?tls=false", "DatabaseName": { "TrackStateService": "TrackStateServiceDb" }, "CollectionName": { "TrackStateService": "TrackStateServiceCollection" } } },
- Replace the user name (root) and password (mongo) with the user name had password you created previously
- Search for a section called MongoDb and look for ConnectionString
- Configure Logging
- Search for a section called Serilog and look for the path
"Serilog": { "Using": [ "Serilog.Sinks.File" ], "MinimumLevel": "Information", "Enrich": [ "WithCorrelationId" ], "WriteTo": [ { "Name": "File", "Args": { "path": "C:\\Riva\\Riva Insight\\Insight\runtime\\Logs\\log.txt", "outputTemplate": "{Timestamp:HH:mm:ss} {Level:u3} [{CorrelationId}] {Message:lj}{NewLine}{Exception}", "rollingInterval": "Day", "fileSizeLimitBytes": "10485760" } } ], "Properties": { "Application": "Riva Track State Service" } },
- You may leave the logs in the default location, or update to keep the logs with the other Riva Insight logs.
- For each folder in the path, add double-slashes.
For example: "path": "C:\\Riva\\Riva Insight\\Insight\runtime\\Logs\\tss.log"
- For each folder in the path, add double-slashes.
- Search for a section called Serilog and look for the path
- Configure JWT Key
- Add the following section (can be added after the “Serilog” section).
- Ensure the comma is added before the new section
, "Jwt": { "Asymmetric": { "PublicKey": "***" } }
- Update the value of the PublicKey with your Riva provided JWT Public Key
Riva Insight App
- Open the webConnectionStrings.xml file
- Add the following connectionStrings to the config:
<add name="Vigo.TrackStateService" connectionString="Uri={TssUrl}"/> <add name="Vigo.JWT" connectionString="PrivateKey={PrivateKey};PublicKey={PublicKey}"/>
- For the Vigo.TrackStateService connection string, replace
{TssUrl}with your TrackStateUrl - For the Vigo.JWT connection string, replace
{PrivateKey}and{PublicKey}with the provided Private and Public keys.
Riva Sync App
NOTE: The TrackStateURL is the FQDN or Server name of the Riva Insight Server, plus the tss virtual path.
I.E. https://{fqdn}/{tssVirtualPath} || https://my.riva.com/insight/trackstateservice
- Open the Riva Sync configuration file
- This file can be found in the RivaSync/Application/Runtime folder
- Depending on your version of Sync, you will have to edit the config file for either the 64-bit or 32-bit version i.e. Omni.Riva.CrmAgentEx.exe.config or Omni.Riva.CrmAgentEx64.exe.config
- Add the following connectionString to the config:
<add name="Insight.TrackStateService" connectionString="Uri={TssUrl};PrivateKey={PrivateKey};PublicKey={PublicKey}" />
- Update the connection string with the following values:
- Replace
{TssUrl}with your TrackStateUrl - Replace
{PrivateKey}and{PublicKey}with the provided Private and Public keys.
- Replace
Confirm (Health Endpoints)
Confirm that health check endpoints are accessible
- You can confirm that the application is working by navigating to
- {TrackStateUrl}/api/trackstateservice/trackstate/health
- I.E. https://my.riva.com/Insight/trackstateservice/api/trackstateservice/trackstate/health
- You can then also confirm that the database is accessible by navigating to
- {TrackStateUrl}/api/trackstateservice/trackstate/health/database
- I.E. https://my.riva.com/Insight/trackstateservice/api/trackstateservice/trackstate/health/database
Enable Enhanced Track in CRM (Track State Service)
For Enhanced Track in CRM, the Track State Service must be enabled by both Insight and Sync.
Riva Insight
- In the AppSettings.xml file or OnPremise.xml file, add the following key:
<add key="Feature.Track.TrackStateService.IsEnabled" value="true" />
- Restart Riva Insight Server after making the change.
- Reload Settings or Flush Redis.
Riva Sync
- In the Riva Sync Policy Advanced Options,
- Ensure the DefaultUrl is present and points to a valid insight Url. I.E> https://my.riva.com/insight/
Sync.Crm.SyncConfiguration.Insight.DefaultUrl = {InsightEndpoint)
- Enable the Track State Service
Sync.Crm.TrackStateService.Enabled = true
- Ensure the DefaultUrl is present and points to a valid insight Url. I.E> https://my.riva.com/insight/
-
Restart Riva Sync Service after making the change.
Verification
- After making the changes in Riva Sync
- Ensure the mailbox(es) goes though at least one sync cycle
- Verify logs to confirm no Track State Service errors
- Close and re-open Outlook (to force download of Sync Configuration)
- Log out and back into Riva Insight (to ensure latest are picked up)
- Go to the Insight About page to verify TSS has been enabled: