With the Embed option, you can easily embed Agora Analytics pages in internal web portals using a low-code approach.
To use the Embed option, ensure that the following requirements are met:
This section explains how to embed Agora Analytics pages in your portal using the Embedding Configuration dialog.
To access Embedding Configuration, do the following:
Send an HTTP request from your server to query the URL that opens the Agora Analytics feature page you want to embed. A feature page is the page you access directly from the left navigation panel of Agora Analytics in Agora Console.
The Embedding Configuration dialog shows a code sample for Node.js:
clientSecretto generate the
Authorizationparameter in the HTTP request header. To get your
clientSecret, click Apply above the code snippet in the dialog.
feature, which represents the Agora Analytics feature page you want to embed. You can set it to one of the following options:
callSearch: The Call Inspector page.
dataInsightUsage: The Usage Overview page.
dataInsightQuality: The Quality Overview page.
realtimeMonitoring: The Real-time Monitoring page.
notificationManage: The Alert Notificationss page.
The response is in JSON format and returns the URL to the feature page you request. For example, if your request specifies
callSearch, the response looks like this:
token parameter is a dynamic key that expires in two hours. You need to renew it every two hours.
If you want to request the URL to a detailed Call Inspector page, see URL to a detailed Call Inspector page.
You can customize the content in the embedded Agora Analytics page using the Page Attributes panel. Settings in the panel are transformed into parameters in the code snippet in real time, and these parameters are appended to the URL you get from 1. Request the URL for Embed.
For example, if you select English for Language,
&locale=en is appended to the URL.
The following table lists each setting in Page Attributes and their corresponding parameters in the code snippet:
|Setting||Setting description||Parameter||Parameter Description|
|Language||The language of the report.||
|Time Zone||The timezone used in the report.||
||Whether to show the project selector:
|Default Project||The default project displayed in the report.||(Optional)
||The ID of the project. Set this parameter only when
iframeUrlwith the final complete URL you get from previous steps.
To get the URL to a detailed Call Inspector page, append the following parameters to this URL:
tokenparameter returned in 1. Request the URL for Embed when you set
cname: The channel name. If you enter an invalid channel name, you see a call search page with no research result.
If you only append
cname to the URL, the embedded page displays the call search results for the last three days. To get a more detailed page, you can append the following optional parameters:
fromUid: The user ID of the local client.
toUid: The user ID of the remote client.
fromTs: The start point (Unix timestamp) of the time frame to query.
toTs: The end point (Unix timestamp) of the time frame to query.
Q: Why is the embedded page blank in my web portal?
A: Your browser may block the page due to security concerns. You can try the following solutions: