CoolaData enables you to embed your CoolaData reports in any web page framework, while enjoying the full benefit of CoolaData’s visualization options.

Get Your CoolaData User API Token

To get your CoolaData API token click the Profile icon at the top right of the window and copy your API Token.

Get the Report ID

  1. Create/Open a Report in CoolaData. See Creating Reports.
  2. In the Report Editing window, copy the report ID which is the last part of its URL.
    5-6

 

Prepare the CoolaData Report Request

The following are the mandatory parts of a request for embedding a CoolaData report script in your site.

Use the retrieved User API Token as described in Step 2 in, and the retrieved Report ID, as described in Step 3.

Method: Post

Request URI: https://app.cooladata.com/1/embeddedReports

Content Type: application/json

Payload:

The response to the request above is a single report token according to the parameters of the request. A token expires immediately after being used or within five minutes, if it is not used.

 

More Options for the CoolaData payload request

Here are a few more options that you can include in your CoolaData report request in order to get back the visualization and data that you want.

Dashboard ID

Including a dashboard ID in the request returns the same view as is currently displayed in this dashboard of this user (the user is determined by the API token). This means that the report script represents the same date range and filters as in the dashboard.

To get the dashboard ID, open the dashboard and then copy the dashboard ID from the right of its URL:

Note: If the report has an active date range or filter override, then the report’s date range and filters are used. Otherwise, the dashboard’s date range and filters are used, as set by the user of this API token.

Date Range

If the request does not include a specific date range, then the report’s date range is returned.

Adding a date range to the request takes precedence over the date range defined in the CoolaData console for this report and dashboard.

To specify a date range, use one of the following options:

  • Date Range Expression:

– OR –

  • Custom Range: Epoch milliseconds – you can send any millisecond during the date. CoolaData converts it to the first second of the Start date and the last second of the End date.
    Start date (actualFrom): is converted to “YYYY-MM_DD 00:00:00”.
    End date (actualTo): is converted to “YYYY-MM-DD 23:59:59”.

 

Filters

If the request does not include a specific filter (as described below), then the report’s filters determine the data that is returned.

Adding filters to the request takes precedence over the filter defined in the CoolaData console for this report and dashboard. Multiple conditions can be entered in the slicer section of the request. All conditions can either be specified with an AND or an OR Boolean operator.

Specify the name of an event property, an operator and a value.

 

Fetch the CoolaData Report

Use the report token that you received (as described above) in the following API to fetch the report visualization (Method – GET). Then, embed it in any webpage framework.

 

Example

Using all the above options.

Request the Report Token:

Response:

Fetch the report:

The embedded report will look like this:

Print Friendly