Embedding Dashboards

You can publish your dashboards either in your internal apps or publicly using our embedded dashboards feature. In order to enable the embedding, go to dashboard settings (three dots on the top-top side) and click Embed Dashboard.

Once you enable the embedding, we will create a unique API key for your dashboard and create an example token that allows you to embed the dashboards in a secure way.

By default, all the dashboard filters will be exposed to the users but you can enforce a dashboard filter and hide it in the embedded dashboard by creating a token for the filter.

Let's say that we have the following dashboard with 2 filters:

If you want to enforce the context_campign_source filter in the embedded dashboard and hide the filter from the user, create the token using JWT the following way:

{"filters": [{"name": "context_campaign_source", "items": [{"valueType": "string", "operator": "equals", "value": "test"}]}]}{"filters": [{"name": "context_campaign_source", "items": [{"valueType": "string", "operator": "equals", "value": "test"}]}]}

{"filters": [{"name": "context_campaign_source", "items": [{"valueType": "string", "operator": "equals", "value": "test"}]}]}

And embed the following URL using the generated token:

https://app.rakam.io/embed/dashboard?id=[ID]&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.W3sibmFtZSI6ImNvbnRleHRfY2FtcGFpZ25fc291cmNlIiwiaXRlbXMiOlt7InZhbHVlVHlwZSI6InN0cmluZyIsIm9wZXJhdG9yIjoiZXF1YWxzIiwidmFsdWUiOiJ0ZXN0In1dfV0.HkqKUIoaFsdLGg8wIKTbBYAElxnl0ejWvlS6l_Ss-Do

We will only apply your filter automatically to all the reports in the dashboard and hide it from the user as follows:

Embedding Reports

You can publish your reports either in your internal apps or publicly if you want users to run ad-hoc queries on the data. In order to enable the embedding, go to report settings (three dots on the top-top side) and click Export and then embed.

If you embed a saved report, your embeds will also be updated automatically. If not, you will be embedding the report definition.

Query Parameters

parameter

type

description

builder

boolean

hide/show the query builder

Custom Reports

If you would like to let the users modify & execute the queries interacting with the builder, you can generate your token programmatically. Here are the parameters for the token:

body parameter

type

example

type

report type (required)

segmentation

options

report options

{"measures": ["total_rows"]}

allowedModels

List

["campaigns"]
(it's optional but if you send this parameter, the users will be able to run ad-hoc queries)

defaultDateRange

date range for event timestamp

P2W

filters

List

[{"dimension": 'name', "operator": "equals", "value": "test"}]

The report filter will be hidden from the end user and it will be forced in the backend.

You need to create a JSON blob using the properties above and use your Embed Key as a JWT secret.