Amplitude

Knowi connects to Amplitude's Dashboard REST API to pull user analytics, session data, event segmentation, retention analysis, and chart data directly into your dashboards.

Combine Amplitude product analytics with data from your databases, CRM, and other tools for a complete view of user behavior and business metrics.

Overview

Connect to Amplitude using your API credentials. Knowi supports 8 collections covering users, sessions, events, composition, retention, and direct chart data extraction.

Connecting

  1. Log in to Knowi and select "Queries" from the left sidebar.

  2. Click on the "New Datasource +" button and select Amplitude from the list of datasources.

  3. Enter your Amplitude API credentials:

    a. API Key - Your Amplitude API key (found in Amplitude under Settings > Projects > your project).

    b. API Secret - Your Amplitude API secret.

    The credentials are formatted as apiKey:secretKey for HTTP Basic authentication.

  4. Click "Save" to finish setup.

Collections

Data From Chart

Pulls data directly from an existing Amplitude chart by its chart ID. This is the simplest way to get data if you already have charts configured in Amplitude.

Required Parameters: * Chart Id - The chart ID from the Amplitude URL. For example, if the chart URL is https://analytics.amplitude.com/someacc/chart/i0wqjyd, the Chart ID is i0wqjyd.

Users

Retrieves active or new user counts over a date range.

Required Parameters: * Start - Start date in YYYYMMdd format. Supports Knowi date tokens: {$c9_today-7d:YYYYMMdd}. * End - End date in YYYYMMdd format.

Optional Parameters: * New/Active - Filter by new users or active users (default: active).

Session Length Distribution

Retrieves session length distribution histograms.

Required Parameters: * Start / End - Date range in YYYYMMdd format.

Optional Parameters: * Bucket Minimum / Maximum - Min/max values for histogram bucketing. * Time Unit - Unit for bucket sizes: Hours, Minutes, or Seconds.

Average Session Length

Retrieves average session length over a date range.

Required Parameters: * Start / End - Date range in YYYYMMdd format.

Average Sessions Per User

Retrieves average sessions per user over a date range.

Required Parameters: * Start / End - Date range in YYYYMMdd format.

User Composition

Breaks down users by a specified property (country, platform, OS, device, etc.).

Required Parameters: * Start / End - Date range in YYYYMMdd format. * Composition Property - Property to analyze: Version, Country, City, Region, DMA, Language, Platform, OS, Device, Start Version, or Paying. For custom properties, use gp:property_name.

Events

Event segmentation ? the most flexible collection. Supports segments, grouping, formulas, and time granularity.

Required Parameters: * Event JSON - Event definition in JSON format. See the Amplitude event format docs. * Start / End - Date range in YYYYMMdd format.

Optional Parameters: * Metrics - uniques, totals, pct_dau, average, histogram, sums, value_avg, or formula. * Time Segment - Granularity: -300000 (real-time), -3600000 (hourly), 1 (daily), 7 (weekly), 30 (monthly). * Segment Definition JSON - Segment filters. * Grouping Property - Property to group results by. * Limit - Number of group-by values (default: 100, max: 1000). * Formula - Custom formula (e.g., UNIQUES(A)/UNIQUES(B)).

Funnel Analysis

Retention and funnel analysis between start and return events.

Required Parameters: * Start Event JSON / Return Event JSON - Event definitions. Start event supports _new (new users) and _active (all users). Return event supports _all and _active. * Start / End - Date range.

Optional Parameters: * Retention Type - bracket, rolling, or n-day (default). * Bracket Days - Day ranges for bracket retention (e.g., [0,5]). * Time Segment / Segment Definition / Grouping - Same as Events collection.

Cloud9QL for Amplitude Data

Amplitude returns nested data structures that require Cloud9QL to flatten. Most collections include a default Cloud9QL transformation:

(
  select data.xValues as XValues;
  select expand(XValues);
  select *, 1 as counter;
  select *, accumulate(counter) as pos;
)
append (
  select data.series.[*].[*] as series;
  select expand(series);
  select *, 1 as counter;
  select *, accumulate(counter) as pos;
);

select Xvalues, series as Val group by pos

This unpacks Amplitude's xValues (dates/labels) and series (metric values) into a flat table.

Scheduling

Schedule queries to run automatically to keep dashboards current. Amplitude date parameters support Knowi date tokens, so you can use {$c9_today-7d:YYYYMMdd} for rolling date windows.

Notes