CoolaData enables you to embed your CoolaData reports in any web page framework, while enjoying the full benefit of CoolaData’s visualization options.
The embedded report will look like this:
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
- Create/Open a Report in CoolaData. See Creating Reports.
- In the Report Editing window, copy the report ID which is the last part of its URL.
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.
Request URI: https://app.cooladata.com/1/embeddedReports
Content Type: application/json
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.
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.
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:
– OR –
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.
"operator": "INTEGER_EQUALS | INTEGER_NOT_EQUALS | STRING_EQUALS | STRING_NOT_EQUALS | INTEGER_IN_LIST | INTEGER_NOT_IN_LIST | STRING_IN_LIST | STRING_NOT_IN_LIST | CONTAINS | NOT_CONTAINS | EXISTS | NOT_EXISTS | REGEX | AT_LEAST | NO_MORE_THAN | BETWEEN | TIME_BETWEEN | LATER_THAN | EARLIER_THAN",
"values": ["value1", "value2"]
To use segmentation in filters, add the following condition:
"operator": "IS_IN_SEGMENT_TABLE | NOT_IN_SEGMENT_TABLE"
You can use multiple segment conditions in the same query.
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.
Using all the above options.
Request the Report Token:
"values": ["Chrome", "Android Browser"]
Fetch the report: