Dashboard
The dashboard object: scopes, sections, cards, charts, filters, and transformations.
Your goal
Understand the dashboard structure well enough to lay one out deliberately - and to work in advanced mode when the interface cannot do what you need.
The object model
A dashboard is a DashboardRegistration: a title, scopes, and a DashboardContent. The content is composed of sections and cards, and cards organise charts.
Scopes: where a dashboard appears
home
The datamart's home page.
segments
The segments page - all segments, or a specific set with segment IDs in segment_ids.
builders
Standard segment builders - all of them, or a specific set with builder IDs in builder_ids.
You can have several dashboards at the same scope. When you do, tabs are created to switch between them; with a single dashboard there are no tabs.
Sections and cards
Each section has a title and cards arranged on a grid. Each card is a white block organising charts horizontally or vertically.
The grid is 12 columns wide, with as many rows as needed. Size and position come from these properties:
h
The number of rows the card takes.
w
The number of columns the card takes.
x, y
The coordinates of the card's top-left corner on the grid.
So a full-width card is w: 12, and two side-by-side cards are w: 6 with x: 0 and x: 6.
Charts
Each chart has a title, a type, a dataset, and optionally colours and options.
title
Can be an empty string.
type
Bars, Pie, Metric, or Radar.
dataset
The data source - an OTQL query referenced by query_id, or an activities analytics query.
options
Depends on the chart type.
Working in advanced mode
Save the query as a technical query
Run it in the Query Tool and save it as a technical query. Note the query ID.
Filters
A dashboard can have filters in the top action bar - a compartment or channel selector, for example. The user picks a value and every query in the dashboard adapts to it.
Filters can only be set up in advanced mode, through the available_filters property of the DashboardContent.
Transformations
Transformations reshape a dataset before it is charted. The available ones:
to-list
Turns a result into a list.
join
Combines datasets.
to-percentages
Converts values to percentages.
ratio
Calculates a ratio between values.
index
Produces an index - the basis of audience comparison charts.
format-dates
Formats date keys.
reduce
Reduces a series to a single value - for instance to display a @cardinality query as a metric.
get-decorators
Resolves schema decorators so labels read properly.
Worked uses are in Dashboard cookbook.
Related pages
Last updated
Was this helpful?