Contact usRequest a demo

Setting up account-based analytics

This is a preview feature. It may be subject to change or removal with no further notice.

To enable preview features, set com.unblu.platform.enablePreview to true.

For more information on preview features, refer to the Unblu release policy.

To use Unblu’s account-based analytics feature, work through the following steps:

Analytics data collection starts only after the database backend is deployed and configured. Historical data isn’t backfilled.

Step 1: Deploy the analytics database backend

The Collaboration Server supports two database backends for account-based analytics: BigQuery and PostgreSQL. BigQuery is the default for deployments on Google Cloud, including the Unblu Cloud. PostgreSQL is the default for any deployment that isn’t on Google Cloud, including Unblu Cloud deployments hosted elsewhere.

BigQuery

In Google Cloud deployments, the Collaboration Server requires a BigQuery dataset as the backend. Before configuring the Collaboration Server, ensure the following:

  • A BigQuery dataset exists in your Google Cloud project.

    For Unblu Cloud installations, the Unblu Site Reliability Engineering (SRE) team provisions the dataset. Self-managed deployments on Google Cloud provision the dataset themselves.

  • The Collaboration Server can authenticate to Google Cloud using Application Default Credentials (ADC) with the following IAM roles:

    • roles/bigquery.dataEditor on the dataset.

    • roles/bigquery.jobUser and roles/serviceusage.serviceUsageConsumer at the project level.

The Collaboration Server creates the analytics schema — a raw event table and a set of views — on startup.

PostgreSQL

For self-managed deployments outside Google Cloud, the Collaboration Server requires a PostgreSQL database as the backend. Before configuring the Collaboration Server, ensure the following:

  • A reachable PostgreSQL instance, version 14 or later, with an existing database.

  • A database user with CREATE permissions on the target schema.

    The Collaboration Server creates a raw event table, views, and stored procedures on startup, so the user must be permitted to create these objects.

The following example script creates a database and a user that satisfy these requirements:

Listing 1. Example PostgreSQL initialization script
CREATE USER unblu_analytics WITH PASSWORD 'your_analytics_password'; (1)
CREATE DATABASE unblu_analytics;

\connect unblu_analytics

GRANT CREATE ON SCHEMA public TO unblu_analytics;
1 Replace 'your_analytics_password' with a password of your choice. The username unblu_analytics is an example; Unblu doesn’t require a specific username.

Step 2: Configure the Collaboration Server

The analytics properties described here are in the IMMUTABLE scope. Set them in the Collaboration Server’s configuration file.

Set com.unblu.analytics.database to either BIGQUERY or POSTGRES. The default value, DISABLED, turns analytics off entirely. For your changes to take effect, restart the Collaboration Server.

To write data to multiple backends concurrently — for example, while migrating from BigQuery to PostgreSQL — list the extra ingestion backends in com.unblu.analytics.additionalIngestionDatabases. The Collaboration Server then mirrors raw event data to the listed databases alongside the primary backend.

BigQuery

Set com.unblu.analytics.bigquery.dataset to the ID of the BigQuery dataset you want to use. The Google Cloud project ID is derived from the Collaboration Server’s Google Cloud credentials.

PostgreSQL

Set the following properties:

Step 3: Restart and verify

Restart the Collaboration Server. On startup, the Collaboration Server creates or updates the analytics schema for each configured backend.

Analytics is enabled provided com.unblu.analytics.database is set to BIGQUERY or POSTGRES and the database backend is configured correctly. To confirm that data is being collected, configure a dashboard and check that it displays KPI data once events have been recorded. Events are ingested in 30-second batches, so they appear in dashboards once the next batch is written.

See also