Embedded Analytics
Introduction
Embedded Analytics feature helps you integrate a Holistics dashboard into your own web applications, as if the dashboard is a part of your application itself.
Use Cases
- Embed inside your CRM Application, set up the right dashboards for the right customers
- E-commerce/Retails: Embed dashboards into Web/Mobile App to deliver insights to each merchant
- Include your Dashboard or Report publicly on your website
Benefits
- Your Engineers don't have to waste time building the dashboard for your application from scratch.
- Your Viewers/Users don't need to login inside Holistics to view your Dashboard.
- Prevent data leakage: your viewers can only see data that you allow them to see.
- White-labeling: Remove Holistics’ logo so you can keep your brand consistent in your applications.
![Embedded Dashboard](https://cdn.holistics.io/docs/embedded/embedded-dashboard-example.png)
Video Guide
Watch the below video to understand how we set up embedded dashboards step-by-step.
How to set up Embedded Analytics
Here are some useful links which can help you set up your embedded dashboard:
- Tutorial: How to Embed your Holistics Dashboard
- Configure your embedded dashboard:
- Other features:
Security
Please refer to our Security in Embedded Analytics docs for general security matters.
FAQs
For all the common questions about Holistics Embedded Analytics, please refer to our FAQs here.
Sample Code
Below is the sample code of Holistics Embedded Analytics, and we use Ruby
as the example.
# Example code below uses JWT for encoding
# Execute 'gem install jwt' (or add gem 'jwt' to your GemFile) to install it first
embed_code = 'your_embed_code'
secret_key = 'your_secret_key'
# Will expire after 1 day, change it to the value you want.
expired_time = Time.now.to_i + 24 * 60 * 60
settings = {
"enable_export_data": false/true
}
# Row-level Permission Settings
permissions = {
"row_based": [
# permission rule 1
{
"path": "data_set_name.data_model_name.field_name",
"operator": "expected_operator",
"modifier": nil,
"values": [
"your_expected_value"
]
},
# permission rule 2
{
"path": "data_set_name.data_model_name.field_name",
"operator": "expected_operator",
"modifier": nil,
"values": [
"your_expected_value"
]
}
]
}
# Controls Settings
filters = {
"your_filter_name": {
"hidden": false/true,
"default_condition": {
"operator": "THE_OPERATOR",
"values": ["your default value"],
"modifier": "THE_MODIFIER"
}
}
}
# Enable Drill-Through for your Embedded Dashboard
drillthroughs = {
"destination_dashboard_id_1": {
# other settings of this destination dashboard go here
},
"destination_dashboard_id_2": {
# other settings of this destination dashboard go here
}
}
# Add all above settings to the payload
payload = {
settings: settings,
permissions: permissions,
filters: filters,
drillthroughs: drillthroughs,
exp: expired_time,
}
# Generate Embed Token
token = JWT.encode(payload, secret_key, 'HS256')
After that, you need to include the HTML iframe in your application:
<!-- Embedded Ruby(erb) template -->
<iframe
src="https://secure.holistics.io/embed/<%= embed_code %>?_token=<%= token %>"
style="width: 100%; height: 600px;"
frameborder="0"
allowfullscreen
>
</iframe>